Class MicroSAXHandler
java.lang.Object
com.helger.xml.microdom.serialize.MicroSAXHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,EntityResolver2,LexicalHandler
public class MicroSAXHandler
extends Object
implements EntityResolver2, DTDHandler, ContentHandler, ErrorHandler, LexicalHandler
The SAX handler used by the
MicroReader.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionMicroSAXHandler(boolean bSaveIgnorableWhitespaces, EntityResolver aEntityResolver, boolean bTrackPosition) -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] aChars, int nStart, int nLength) voidcomment(char[] aChars, int nStart, int nLength) voidendCDATA()voidvoidendDTD()voidendElement(String sNamespaceURI, String sLocalName, String sQName) voidvoidendPrefixMapping(String sPrefix) voidvoidgetExternalSubset(String sName, String sBaseURI) voidignorableWhitespace(char[] aChars, int nStart, int nLength) voidnotationDecl(String sName, String sPublicId, String sSystemId) voidprocessingInstruction(String sTarget, String sData) resolveEntity(String sPublicId, String sSystemId) resolveEntity(String sName, String sPublicId, String sBaseURI, String sSystemId) voidsetDocumentLocator(Locator aLocator) voidskippedEntity(String sName) voidvoidvoidvoidstartElement(String sNamespaceURI, String sLocalName, String sQName, Attributes aAttributes) voidstartEntity(String sName) voidstartPrefixMapping(String sPrefix, String sNamespaceURI) voidunparsedEntityDecl(String sName, String sPublicId, String sSystemId, String sNotationName) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
MicroSAXHandler
public MicroSAXHandler(boolean bSaveIgnorableWhitespaces, @Nullable EntityResolver aEntityResolver, boolean bTrackPosition)
-
-
Method Details
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceContentHandler
-
endDocument
public void endDocument()- Specified by:
endDocumentin interfaceContentHandler
-
startDTD
- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
startElement
public void startElement(@Nullable String sNamespaceURI, @Nonnull String sLocalName, @Nullable String sQName, @Nullable Attributes aAttributes) - Specified by:
startElementin interfaceContentHandler
-
endElement
- Specified by:
endElementin interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler
-
characters
- Specified by:
charactersin interfaceContentHandler
-
comment
public void comment(@Nonnull char[] aChars, @Nonnegative int nStart, @Nonnegative int nLength) throws SAXException - Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(@Nonnull char[] aChars, @Nonnegative int nStart, @Nonnegative int nLength) - Specified by:
ignorableWhitespacein interfaceContentHandler
-
resolveEntity
@Nullable public InputSource resolveEntity(String sPublicId, String sSystemId) throws IOException, SAXException - Specified by:
resolveEntityin interfaceEntityResolver- Throws:
IOExceptionSAXException
-
getExternalSubset
@Nullable public InputSource getExternalSubset(String sName, @Nullable String sBaseURI) throws SAXException, IOException - Specified by:
getExternalSubsetin interfaceEntityResolver2- Throws:
SAXExceptionIOException
-
resolveEntity
@Nullable public InputSource resolveEntity(@Nullable String sName, @Nullable String sPublicId, @Nullable String sBaseURI, @Nonnull String sSystemId) throws SAXException, IOException - Specified by:
resolveEntityin interfaceEntityResolver2- Throws:
SAXExceptionIOException
-
unparsedEntityDecl
public void unparsedEntityDecl(String sName, String sPublicId, String sSystemId, String sNotationName) - Specified by:
unparsedEntityDeclin interfaceDTDHandler
-
notationDecl
- Specified by:
notationDeclin interfaceDTDHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler
-
startEntity
- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(@Nonnull String sPrefix, @Nonnull String sNamespaceURI) throws SAXException - Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
warning
- Specified by:
warningin interfaceErrorHandler
-
error
- Specified by:
errorin interfaceErrorHandler
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler
-
getDocument
- Returns:
- The created and filled micro document. May be
nullif no document start event came in.
-
getSourceXMLVersion
- Returns:
- The XML version read. May be
null.
-
getSourceXMLEncoding
- Returns:
- The source encoding of the read XML. May be
null.
-