Package org.dom4j.io
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
org.dom4.ElementHandler
is still
handling the current Element.- 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 boolean
void
characters
(char[] parm1, int parm2, int parm3) void
comment
(char[] characters, int parm2, int parm3) void
endCDATA()
void
void
endDTD()
void
endElement
(String uri, String localName, String qName) void
void
endPrefixMapping
(String prefix) protected XMLWriter
void
ignorableWhitespace
(char[] parm1, int parm2, int parm3) void
notationDecl
(String name, String publicId, String systemId) Receive notification of a notation declaration event.void
processingInstruction
(String target, String data) void
setDocumentLocator
(Locator locator) void
setXMLWriter
(XMLWriter writer) void
skippedEntity
(String name) void
void
void
void
startElement
(String uri, String localName, String qName, Attributes atts) void
startEntity
(String name) void
startPrefixMapping
(String prefix, String uri) void
unparsedEntityDecl
(String name, String publicId, String systemId, String notation) Receive notification of an unparsed entity declaration event.Methods inherited from class org.dom4j.io.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, warning
Methods inherited from class org.xml.sax.helpers.DefaultHandler
resolveEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.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:
startCDATA
in interfaceLexicalHandler
- Overrides:
startCDATA
in classSAXContentHandler
- Throws:
SAXException
-
startDTD
- Specified by:
startDTD
in interfaceLexicalHandler
- Overrides:
startDTD
in classSAXContentHandler
- Throws:
SAXException
-
endDTD
- Specified by:
endDTD
in interfaceLexicalHandler
- Overrides:
endDTD
in classSAXContentHandler
- Throws:
SAXException
-
comment
- Specified by:
comment
in interfaceLexicalHandler
- Overrides:
comment
in classSAXContentHandler
- Throws:
SAXException
-
startEntity
- Specified by:
startEntity
in interfaceLexicalHandler
- Overrides:
startEntity
in classSAXContentHandler
- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATA
in interfaceLexicalHandler
- Overrides:
endCDATA
in classSAXContentHandler
- Throws:
SAXException
-
endEntity
- Specified by:
endEntity
in interfaceLexicalHandler
- Overrides:
endEntity
in classSAXContentHandler
- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notation) throws SAXException Description copied from class:SAXContentHandler
Receive notification of an unparsed entity declaration event.Note that the notation name corresponds to a notation reported by the
notationDecl
event. 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:
unparsedEntityDecl
in interfaceDTDHandler
- Overrides:
unparsedEntityDecl
in 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:SAXContentHandler
Receive 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:
notationDecl
in interfaceDTDHandler
- Overrides:
notationDecl
in 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:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classSAXContentHandler
- Throws:
SAXException
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classSAXContentHandler
- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in classDefaultHandler
- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Overrides:
processingInstruction
in classSAXContentHandler
- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classSAXContentHandler
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Overrides:
skippedEntity
in classDefaultHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classSAXContentHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classSAXContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classSAXContentHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classSAXContentHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classSAXContentHandler
- Throws:
SAXException
-
getXMLWriter
-
activeHandlers
private boolean activeHandlers()
-