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, warningprotected 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 ContentHandlerstartElement in class DefaultHandlerSAXExceptionpublic void characters(char[] chars,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerpublic void endElement(String nsuri, String lname, String qname) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandler