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
class SAXModifyContentHandler extends SAXContentHandler
This extension of the SAXContentHandler writes SAX events immediately to the provided XMLWriter, unless someorg.dom4.ElementHandleris still handling the current Element.- Author:
- Wonne Keysers (Realsoftware.be)
- See Also:
SAXContentHandler
-
-
Constructor Summary
Constructors Constructor Description SAXModifyContentHandler()SAXModifyContentHandler(DocumentFactory documentFactory)SAXModifyContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler)SAXModifyContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler, ElementStack elementStack)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] parm1, int parm2, int parm3)voidcomment(char[] characters, int parm2, int parm3)voidendCDATA()voidendDocument()voidendDTD()voidendElement(String uri, String localName, String qName)voidendEntity(String name)voidendPrefixMapping(String prefix)protected XMLWritergetXMLWriter()voidignorableWhitespace(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)voidstartCDATA()voidstartDocument()voidstartDTD(String name, String publicId, String systemId)voidstartElement(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 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
-
-
-
-
Constructor Detail
-
SAXModifyContentHandler
public SAXModifyContentHandler()
-
SAXModifyContentHandler
public SAXModifyContentHandler(DocumentFactory documentFactory)
-
SAXModifyContentHandler
public SAXModifyContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler)
-
SAXModifyContentHandler
public SAXModifyContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler, ElementStack elementStack)
-
-
Method Detail
-
setXMLWriter
public void setXMLWriter(XMLWriter writer)
-
startCDATA
public void startCDATA() throws SAXException- Specified by:
startCDATAin interfaceLexicalHandler- Overrides:
startCDATAin classSAXContentHandler- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTDin interfaceLexicalHandler- Overrides:
startDTDin classSAXContentHandler- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXException- Specified by:
endDTDin interfaceLexicalHandler- Overrides:
endDTDin classSAXContentHandler- Throws:
SAXException
-
comment
public void comment(char[] characters, int parm2, int parm3) throws SAXException- Specified by:
commentin interfaceLexicalHandler- Overrides:
commentin classSAXContentHandler- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntityin interfaceLexicalHandler- Overrides:
startEntityin classSAXContentHandler- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException- Specified by:
endCDATAin interfaceLexicalHandler- Overrides:
endCDATAin classSAXContentHandler- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- 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:
SAXContentHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String),AttributeList
-
notationDecl
public void notationDecl(String name, String publicId, String systemId) throws SAXException
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:
SAXContentHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String),AttributeList
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classSAXContentHandler- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classSAXContentHandler- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] parm1, int parm2, int parm3) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classDefaultHandler- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classSAXContentHandler- Throws:
SAXException
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classSAXContentHandler
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classDefaultHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classSAXContentHandler- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classSAXContentHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classSAXContentHandler- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classSAXContentHandler- Throws:
SAXException
-
characters
public void characters(char[] parm1, int parm2, int parm3) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classSAXContentHandler- Throws:
SAXException
-
getXMLWriter
protected XMLWriter getXMLWriter()
-
-