|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler org.sadun.util.xml.SimplePathMapCreatorHandler
This SAX handler can be used to create a map of simple paths to node values of an XML document.
After parsing, the method getValue(path)
returns the textual value
of the note indicated by the path. Paths are in the form
/tag1/tag2/... /tag1/tag2/@attribute
Constructor Summary | |
SimplePathMapCreatorHandler()
Construct an instance that trims whitespace in values. |
|
SimplePathMapCreatorHandler(boolean trimWhiteSpace)
Construct an instance that trims whitespace in values depending on the value of the given parameter. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
java.lang.String |
getValue(java.lang.String path)
Return the textual value of the note indicated by the path. |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes atts)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimplePathMapCreatorHandler(boolean trimWhiteSpace)
trimWhiteSpace
- if true, the instance will trim whitespace.public SimplePathMapCreatorHandler()
Method Detail |
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String name, 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 java.lang.String getValue(java.lang.String path)
PathMap
getValue
in interface PathMap
path
- the path, in a given path language
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |