|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Configurator is a SAX Content handler which receives SAX events pertaining only to a specific element in an XML document (and typically reacts incrementally configuring an associated object, hence the name).
For example, when parsing the following XML
<?xml version="1.0"?> <elem1> <sub-elem1> ... </sub-elem1> <sub-elem2> ... </sub-elem2> </elem1> >we might want to handle sub-elem1 and sub-elem2 with specific classes rather than into a single big SAX ContentHandler.
A Configurator is usually associated to an XML tag via some name
transformation. For example, parsing the XML via a SAX parser
by using a DispatcherHandler
,
a Configurator class can be associated to each element, which will
receive only SAX events pertaining to that element.
Method Summary | |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
|
java.lang.Object |
getConfiguredObject()
Return the object resulting from the parsing of the specific XML element handled by this configurator, or null. |
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. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
|
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping |
Method Detail |
public java.lang.Object getConfiguredObject() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public java.lang.String getText()
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |