public class DOMSAXContentHandler
extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.ext.LexicalHandler
SAXContentHandler
builds W3C DOM object via SAX events.
Constructor and Description |
---|
DOMSAXContentHandler() |
DOMSAXContentHandler(DOMDocumentFactory documentFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAttributes(Element element,
org.xml.sax.Attributes attributes) |
protected void |
addDeclaredNamespaces(Element element) |
protected java.lang.String |
attributeNameForNamespace(Namespace namespace) |
void |
comment(char[] ch,
int start,
int end) |
protected void |
completeCurrentTextNode() |
protected Document |
createDocument() |
protected org.dom4j.io.ElementStack |
createElementStack() |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName) |
void |
endEntity(java.lang.String name) |
void |
endPrefixMapping(java.lang.String prefix) |
void |
error(org.xml.sax.SAXParseException exception)
This method is called when an error is detected during parsing such as a
validation error.
|
void |
fatalError(org.xml.sax.SAXParseException exception)
This method is called when a fatal error occurs during parsing.
|
org.w3c.dom.Document |
getDocument()
Retrieves w3c document object built via generated sax events.
|
org.dom4j.io.ElementStack |
getElementStack() |
org.xml.sax.EntityResolver |
getEntityResolver() |
org.xml.sax.InputSource |
getInputSource() |
void |
characters(char[] ch,
int start,
int end) |
boolean |
isIgnoreComments()
Returns whether we should ignore comments or not.
|
boolean |
isMergeAdjacentText()
Returns whether adjacent text nodes should be merged together.
|
boolean |
isStripWhitespaceText()
Sets whether whitespace between element start and end tags should be
ignored
|
void |
processingInstruction(java.lang.String target,
java.lang.String data) |
void |
setDocumentLocator(org.xml.sax.Locator documentLocator) |
void |
setElementStack(org.dom4j.io.ElementStack elementStack) |
void |
setEntityResolver(org.xml.sax.EntityResolver entityResolver) |
void |
setIgnoreComments(boolean ignoreComments)
Sets whether we should ignore comments or not.
|
void |
setInputSource(org.xml.sax.InputSource inputSource) |
void |
setMergeAdjacentText(boolean mergeAdjacentText)
Sets whether or not adjacent text nodes should be merged together when
parsing.
|
void |
setStripWhitespaceText(boolean stripWhitespaceText)
Sets whether whitespace between element start and end tags should be
ignored.
|
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId) |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qualifiedName,
org.xml.sax.Attributes attributes) |
void |
startEntity(java.lang.String name) |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri) |
void |
warning(org.xml.sax.SAXParseException exception)
This method is called when a warning occurs during the parsing of the
document.
|
public DOMSAXContentHandler()
public DOMSAXContentHandler(DOMDocumentFactory documentFactory)
public org.w3c.dom.Document getDocument()
public void setDocumentLocator(org.xml.sax.Locator documentLocator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
processingInstruction
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
startPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
endPrefixMapping
in interface org.xml.sax.ContentHandler
endPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void characters(char[] ch, int start, int end) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
exception
- DOCUMENT ME!org.xml.sax.SAXException
- DOCUMENT ME!public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
exception
- DOCUMENT ME!org.xml.sax.SAXException
- DOCUMENT ME!public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
exception
- DOCUMENT ME!org.xml.sax.SAXException
- DOCUMENT ME!public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
startDTD
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endDTD() throws org.xml.sax.SAXException
endDTD
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
startEntity
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException
endEntity
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void startCDATA() throws org.xml.sax.SAXException
startCDATA
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endCDATA() throws org.xml.sax.SAXException
endCDATA
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void comment(char[] ch, int start, int end) throws org.xml.sax.SAXException
comment
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public org.dom4j.io.ElementStack getElementStack()
public void setElementStack(org.dom4j.io.ElementStack elementStack)
public org.xml.sax.EntityResolver getEntityResolver()
public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
public org.xml.sax.InputSource getInputSource()
public void setInputSource(org.xml.sax.InputSource inputSource)
public boolean isMergeAdjacentText()
public void setMergeAdjacentText(boolean mergeAdjacentText)
mergeAdjacentText
- New value of property mergeAdjacentText.public boolean isStripWhitespaceText()
public void setStripWhitespaceText(boolean stripWhitespaceText)
stripWhitespaceText
- New value of property stripWhitespaceText.public boolean isIgnoreComments()
public void setIgnoreComments(boolean ignoreComments)
ignoreComments
- whether we should ignore comments or not.protected void completeCurrentTextNode()
protected Document createDocument()
protected void addDeclaredNamespaces(Element element)
protected void addAttributes(Element element, org.xml.sax.Attributes attributes)
protected org.dom4j.io.ElementStack createElementStack()
protected java.lang.String attributeNameForNamespace(Namespace namespace)