| 
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.sadun.util.xml.configuration.BaseConfigurator
A base Configurator.
 
This class extends SAX's DefaultHandler and provides support for:
characters() method);
 getConfiguredObject()
      throws an exception if parsing hasn't completed yet (via the
      checkCompleted() method).
 
 Subclasses which override endElement() should either invoke
 this class' implementation or set to true the protected 
 completed field when the configured object
 is complete.
| Field Summary | |
protected  java.lang.StringBuffer | 
buffer
The buffer collecting text received by characters(). | 
protected  boolean | 
completed
Indicate that the object built from the XML is ready.  | 
| Constructor Summary | |
BaseConfigurator()
Constructor for BaseConfigurator.  | 
|
| Method Summary | |
 void | 
characters(char[] ch,
           int start,
           int length)
 | 
protected  void | 
checkCompleted()
Throw an IllegalStateException if completed is not true. | 
protected abstract  java.lang.Object | 
doGetConfiguredObject()
 | 
 void | 
endElement(java.lang.String namespaceURI,
           java.lang.String localName,
           java.lang.String qName)
Set completed to true. | 
protected  boolean | 
getBooleanText(java.lang.String localName)
 | 
protected  byte | 
getByteText(java.lang.String localName)
 | 
 java.lang.Object | 
getConfiguredObject()
Return the object resulting from the parsing of the specific XML element handled by this configurator, or null.  | 
protected  double | 
getDoubleText(java.lang.String localName)
 | 
protected  float | 
getFloatText(java.lang.String localName)
 | 
protected  int | 
getIntText(java.lang.String localName)
 | 
protected  long | 
getLongText(java.lang.String localName)
 | 
protected  short | 
getShortText(java.lang.String localName)
 | 
 java.lang.String | 
getText()
Return the text nodes resulting from the parsing of the specific XML element (if any) handled by this configurator, or null.  | 
 java.lang.String | 
getTextAndResetBuffer()
 | 
 java.lang.String | 
getTextAndResetBuffer(boolean trim)
 | 
 boolean | 
isCompleted()
Returns the completed.  | 
 java.lang.String | 
toString()
 | 
| Methods inherited from class org.xml.sax.helpers.DefaultHandler | 
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning | 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface org.sadun.util.xml.configuration.Configurator | 
startElement | 
| Methods inherited from interface org.xml.sax.ContentHandler | 
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping | 
| Field Detail | 
protected java.lang.StringBuffer buffer
characters().
protected boolean completed
| Constructor Detail | 
public BaseConfigurator()
| Method Detail | 
public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
completed to true.
endElement in interface Configuratororg.xml.sax.SAXException
public final java.lang.Object getConfiguredObject()
                                           throws org.xml.sax.SAXException
Configurator
getConfiguredObject in interface Configuratororg.xml.sax.SAXExceptionprotected void checkCompleted()
completed is not true.
protected abstract java.lang.Object doGetConfiguredObject()
                                                   throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXExceptionpublic boolean isCompleted()
public final java.lang.String getText()
Configurator
getText in interface Configuratorpublic final java.lang.String getTextAndResetBuffer()
public final java.lang.String getTextAndResetBuffer(boolean trim)
public java.lang.String toString()
protected boolean getBooleanText(java.lang.String localName)
                          throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected short getShortText(java.lang.String localName)
                      throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected int getIntText(java.lang.String localName)
                  throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected long getLongText(java.lang.String localName)
                    throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected byte getByteText(java.lang.String localName)
                    throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected float getFloatText(java.lang.String localName)
                      throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected double getDoubleText(java.lang.String localName)
                        throws org.xml.sax.SAXException
org.xml.sax.SAXException
  | 
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||