Class SAXModifyContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.dom4j.io.SAXContentHandler
org.dom4j.io.SAXModifyContentHandler
- All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, DeclHandler, LexicalHandler
This extension of the SAXContentHandler writes SAX events immediately to the
provided XMLWriter, unless some
is still
handling the current Element.
invalid reference
org.dom4.ElementHandler
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSAXModifyContentHandler(DocumentFactory documentFactory) SAXModifyContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler) SAXModifyContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler, ElementStack elementStack) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanvoidcharacters(char[] parm1, int parm2, int parm3) voidcomment(char[] characters, int parm2, int parm3) voidendCDATA()voidvoidendDTD()voidendElement(String uri, String localName, String qName) voidvoidendPrefixMapping(String prefix) protected XMLWritervoidignorableWhitespace(char[] parm1, int parm2, int parm3) voidnotationDecl(String name, String publicId, String systemId) Receive notification of a notation declaration event.voidprocessingInstruction(String target, String data) voidsetDocumentLocator(Locator locator) voidsetXMLWriter(XMLWriter writer) voidskippedEntity(String name) voidvoidvoidvoidstartElement(String uri, String localName, String qName, Attributes atts) voidstartEntity(String name) voidstartPrefixMapping(String prefix, String uri) voidunparsedEntityDecl(String name, String publicId, String systemId, String notation) Receive notification of an unparsed entity declaration event.Methods inherited from class SAXContentHandler
addAttributes, addDeclaredNamespaces, addDTDDeclaration, addExternalDTDDeclaration, attributeDecl, completeCurrentTextNode, createDocument, createElementStack, elementDecl, error, externalEntityDecl, fatalError, getDocument, getElementStack, getEntityResolver, getInputSource, internalEntityDecl, isIgnorableEntity, isIgnoreComments, isIncludeExternalDTDDeclarations, isIncludeInternalDTDDeclarations, isMergeAdjacentText, isStripWhitespaceText, setElementStack, setEntityResolver, setIgnoreComments, setIncludeExternalDTDDeclarations, setIncludeInternalDTDDeclarations, setInputSource, setMergeAdjacentText, setStripWhitespaceText, warningMethods inherited from class DefaultHandler
resolveEntityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContentHandler
declaration
-
Field Details
-
xmlWriter
-
-
Constructor Details
-
SAXModifyContentHandler
public SAXModifyContentHandler() -
SAXModifyContentHandler
-
SAXModifyContentHandler
-
SAXModifyContentHandler
public SAXModifyContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler, ElementStack elementStack)
-
-
Method Details
-
setXMLWriter
-
startCDATA
- Specified by:
startCDATAin interfaceLexicalHandler- Overrides:
startCDATAin classSAXContentHandler- Throws:
SAXException
-
startDTD
- Specified by:
startDTDin interfaceLexicalHandler- Overrides:
startDTDin classSAXContentHandler- Throws:
SAXException
-
endDTD
- Specified by:
endDTDin interfaceLexicalHandler- Overrides:
endDTDin classSAXContentHandler- Throws:
SAXException
-
comment
- Specified by:
commentin interfaceLexicalHandler- Overrides:
commentin classSAXContentHandler- Throws:
SAXException
-
startEntity
- Specified by:
startEntityin interfaceLexicalHandler- Overrides:
startEntityin classSAXContentHandler- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATAin interfaceLexicalHandler- Overrides:
endCDATAin classSAXContentHandler- Throws:
SAXException
-
endEntity
- Specified by:
endEntityin interfaceLexicalHandler- Overrides:
endEntityin classSAXContentHandler- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notation) throws SAXException Description copied from class:SAXContentHandlerReceive notification of an unparsed entity declaration event.Note that the notation name corresponds to a notation reported by the
notationDeclevent. It is up to the application to record the entity for later reference, if necessary.If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
- Specified by:
unparsedEntityDeclin interfaceDTDHandler- Overrides:
unparsedEntityDeclin classSAXContentHandler- Parameters:
name- The unparsed entity's name.publicId- The entity's public identifier, or null if none was given.systemId- The entity's system identifier.notation- The name of the associated notation.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
-
notationDecl
Description copied from class:SAXContentHandlerReceive notification of a notation declaration event.It is up to the application to record the notation for later reference, if necessary.
At least one of publicId and systemId must be non-null. If a system identifier is present, and it is a URL, the SAX parser must resolve it fully before passing it to the application through this event.
There is no guarantee that the notation declaration will be reported before any unparsed entities that use it.
- Specified by:
notationDeclin interfaceDTDHandler- Overrides:
notationDeclin classSAXContentHandler- Parameters:
name- The notation name.publicId- The notation's public identifier, or null if none was given.systemId- The notation's system identifier, or null if none was given.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classSAXContentHandler- Throws:
SAXException
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classSAXContentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classDefaultHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classSAXContentHandler- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classSAXContentHandler
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classDefaultHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classSAXContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classSAXContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classSAXContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classSAXContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classSAXContentHandler- Throws:
SAXException
-
getXMLWriter
-
activeHandlers
private boolean activeHandlers()
-