public class DOMSAXContentHandler extends DefaultHandler implements 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,
Attributes attributes) |
protected void |
addDeclaredNamespaces(Element element) |
protected String |
attributeNameForNamespace(Namespace namespace) |
void |
characters(char[] ch,
int start,
int end) |
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(String namespaceURI,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
error(SAXParseException exception)
This method is called when an error is detected during parsing such as a
validation error.
|
void |
fatalError(SAXParseException exception)
This method is called when a fatal error occurs during parsing.
|
Document |
getDocument()
Retrieves w3c document object built via generated sax events.
|
org.dom4j.io.ElementStack |
getElementStack() |
EntityResolver |
getEntityResolver() |
InputSource |
getInputSource() |
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(String target,
String data) |
void |
setDocumentLocator(Locator documentLocator) |
void |
setElementStack(org.dom4j.io.ElementStack elementStack) |
void |
setEntityResolver(EntityResolver entityResolver) |
void |
setIgnoreComments(boolean ignoreComments)
Sets whether we should ignore comments or not.
|
void |
setInputSource(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(String name,
String publicId,
String systemId) |
void |
startElement(String namespaceURI,
String localName,
String qualifiedName,
Attributes attributes) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
warning(SAXParseException exception)
This method is called when a warning occurs during the parsing of the
document.
|
ignorableWhitespace, notationDecl, resolveEntity, skippedEntity, unparsedEntityDecl
public DOMSAXContentHandler()
public DOMSAXContentHandler(DOMDocumentFactory documentFactory)
public Document getDocument()
public void setDocumentLocator(Locator documentLocator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class DefaultHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class DefaultHandler
SAXException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
public void characters(char[] ch, int start, int end) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void warning(SAXParseException exception) throws SAXException
warning
in interface ErrorHandler
warning
in class DefaultHandler
exception
- DOCUMENT ME!SAXException
- DOCUMENT ME!public void error(SAXParseException exception) throws SAXException
error
in interface ErrorHandler
error
in class DefaultHandler
exception
- DOCUMENT ME!SAXException
- DOCUMENT ME!public void fatalError(SAXParseException exception) throws SAXException
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
exception
- DOCUMENT ME!SAXException
- DOCUMENT ME!public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD
in interface LexicalHandler
SAXException
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
public void startEntity(String name) throws SAXException
startEntity
in interface LexicalHandler
SAXException
public void endEntity(String name) throws SAXException
endEntity
in interface LexicalHandler
SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
public void comment(char[] ch, int start, int end) throws SAXException
comment
in interface LexicalHandler
SAXException
public org.dom4j.io.ElementStack getElementStack()
public void setElementStack(org.dom4j.io.ElementStack elementStack)
public EntityResolver getEntityResolver()
public void setEntityResolver(EntityResolver entityResolver)
public InputSource getInputSource()
public void setInputSource(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, Attributes attributes)
protected org.dom4j.io.ElementStack createElementStack()
Copyright © 2021. All rights reserved.