public class XMLTreeHandler extends ResolverSAXHandler
ResolverSAXHandler.ExceptionResult, ResolverSAXHandler.InformationResult, ResolverSAXHandler.SourceWrapperCACHE_DEFAULT, dtd, ERRORS, FATAL, INFO, locator, NO_ERRORS, publicDTD, resolver, results, status, WARNINGSCACHING_DEFAULT, CACHING_SOURCES, NOT_CACHING_SOURCES| Constructor and Description |
|---|
XMLTreeHandler()
Constructor.
|
XMLTreeHandler(boolean asRoot)
Constructor.
|
XMLTreeHandler(String encoding)
Constructor.
|
XMLTreeHandler(String encoding,
boolean asRoot)
Constructor.
|
XMLTreeHandler(String encoding,
boolean asRoot,
String comment)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] chararacters,
int start,
int length) |
protected XMLNode |
createNodeImpl(QName qname,
Attributes attr)
Create a node.
|
void |
endElement(String uri,
String localname,
String qname) |
void |
endPrefixMapping(String prefix) |
protected void |
errorImpl(SAXParseException e)
Do nothing by default.
|
protected void |
fatalErrorImpl(SAXParseException e)
Do nothing.
|
protected XMLNode |
getCurrentNode()
Return the current node.
|
ErrorHandler |
getErrorHandler()
Return the error handler wich will be fired for parsing errors detected by the parser. null by default.
|
XMLRoot |
getRoot()
Return the root node, as a
XMLRoot. |
XMLNode |
getRootNode()
Return the root node.
|
boolean |
isKeepingLineNumbers()
Return true if line numbers in the XML File are kept.
|
boolean |
isPreservingSpace()
Return true if space characters must be preserved.
|
void |
preserveSpace(boolean preserveSpace)
Set if space characters must be preserved.
|
void |
setErrorHandler(ErrorHandler errorHandler)
Set an error handler wich will be fired for parsing errors detected by the parser.
|
void |
setKeepLineNumbers(boolean keepLineNumbers)
Set if line numbers in the XML File are kept.
|
void |
startElement(String uri,
String localname,
String qname,
Attributes attr)
Receive notification of the beginning of an element.
|
void |
startPrefixMapping(String prefix,
String uri) |
protected void |
warningImpl(SAXParseException e)
Do nothing.
|
endDocument, endDTD, error, error, fatalError, fatalError, getDocumentBaseURL, getDocumentLocator, getDTD, getEntityResolver, getExceptionResults, getExceptions, getExceptionsResultsByLine, getExternalSubset, getFirstException, getInputSourceCaching, getStatus, hasErrors, hasParserExceptions, hasStartedElements, info, info, isDocumentStarted, isElementStarted, reset, resolveEntity, resolveEntity, resolveResource, restart, setDocumentLocator, setDTD, setEntityResolver, setInputSourceCaching, setStatus, startDocument, warning, warningattributeDecl, comment, elementDecl, endCDATA, endEntity, externalEntityDecl, internalEntityDecl, startCDATA, startDTD, startEntityignorableWhitespace, notationDecl, processingInstruction, skippedEntity, unparsedEntityDeclpublic XMLTreeHandler()
public XMLTreeHandler(boolean asRoot)
asRoot - true if the root node must be a XMLRoot.public XMLTreeHandler(String encoding)
encoding - the encoding of the XML filepublic XMLTreeHandler(String encoding, boolean asRoot)
encoding - the encoding of the XML fileasRoot - true if the root node must be a XMLRoot.public void setErrorHandler(ErrorHandler errorHandler)
errorHandler - the error handlerpublic ErrorHandler getErrorHandler()
public void preserveSpace(boolean preserveSpace)
preserveSpace - true if space characters must be preservedpublic boolean isPreservingSpace()
public void setKeepLineNumbers(boolean keepLineNumbers)
keepLineNumbers - true if line numbers in the XML File are keptpublic boolean isKeepingLineNumbers()
public XMLNode getRootNode()
public void startElement(String uri, String localname, String qname, Attributes attr) throws SAXException
startElement in interface ContentHandlerstartElement in class ResolverSAXHandleruri - the Namespace URIlocalname - the local name (without prefix), or the empty string if Namespace processing is not being performedqname - The qualified name (with prefix), or the empty string if qualified names are not availableattr - the specified or defaulted attributesSAXExceptionpublic void endElement(String uri, String localname, String qname)
endElement in interface ContentHandlerendElement in class DefaultHandlerpublic void characters(char[] chararacters,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerprotected XMLNode getCurrentNode()
public void startPrefixMapping(String prefix, String uri)
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerpublic void endPrefixMapping(String prefix)
endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerprotected XMLNode createNodeImpl(QName qname, Attributes attr)
qname - the qualified name of the nodeattr - the node attributesprotected void fatalErrorImpl(SAXParseException e)
ResolverSAXHandler.fatalError(org.xml.sax.SAXParseException).fatalErrorImpl in class ResolverSAXHandlere - the SAXParseExceptionprotected void errorImpl(SAXParseException e)
ResolverSAXHandler.error(org.xml.sax.SAXParseException).errorImpl in class ResolverSAXHandlere - the SAXParseExceptionprotected void warningImpl(SAXParseException e)
ResolverSAXHandler.warning(org.xml.sax.SAXParseException).warningImpl in class ResolverSAXHandlere - the SAXParseException