public abstract class SAXTracker extends DefaultHandler
Modifier and Type | Field and Description |
---|---|
protected StringBuilder |
content
The contents of the current element, or null if not
instructed to keep the contents of the current element.
|
protected Set<String> |
keepContentsOf |
protected Locator |
locator |
protected Stack<String> |
openElements
The stack of currently open elements.
|
Constructor and Description |
---|
SAXTracker() |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] chars,
int start,
int length) |
void |
endElement(String nsuri,
String lname,
String qname) |
boolean |
isParent(String localName)
INTERNAL: Returns true if the parent element has the given name.
|
void |
keepContentsOf(String elementName)
INTERNAL: Instructs the tracker to keep the contents of all
elements with the given name.
|
void |
setDocumentLocator(Locator locator) |
void |
startElement(String nsuri,
String lname,
String qname,
Attributes attrs) |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
protected Locator locator
protected StringBuilder content
public void keepContentsOf(String elementName)
public boolean isParent(String localName)
public void startElement(String nsuri, String lname, String qname, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void characters(char[] chars, int start, int length)
characters
in interface ContentHandler
characters
in class DefaultHandler
public void endElement(String nsuri, String lname, String qname) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler