public static class DomHelper.DOMBuilder extends Object implements ContentHandler
DOMBuilder
is a utility class that will generate a W3C
DOM Document from SAX events.Modifier and Type | Field and Description |
---|---|
protected SAXTransformerFactory |
factory
The transformer factory
|
protected static SAXTransformerFactory |
FACTORY
The default transformer factory shared by all instances
|
protected ContentHandler |
nextHandler |
protected Node |
parentNode
The parentNode
|
protected DOMResult |
result
The result
|
Constructor and Description |
---|
DOMBuilder()
Construct a new instance of this DOMBuilder.
|
DOMBuilder(Node parentNode)
Constructs a new instance that appends nodes to the given parent node.
|
DOMBuilder(SAXTransformerFactory factory)
Construct a new instance of this DOMBuilder.
|
DOMBuilder(SAXTransformerFactory factory,
Node parentNode)
Construct a new instance of this DOMBuilder.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] arg0,
int arg1,
int arg2) |
void |
endDocument() |
void |
endElement(String arg0,
String arg1,
String arg2) |
void |
endPrefixMapping(String arg0) |
Document |
getDocument()
Return the newly built Document.
|
void |
ignorableWhitespace(char[] arg0,
int arg1,
int arg2) |
void |
processingInstruction(String arg0,
String arg1) |
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String arg0) |
void |
startDocument() |
void |
startElement(String uri,
String loc,
String raw,
Attributes attrs) |
void |
startPrefixMapping(String arg0,
String arg1) |
protected static SAXTransformerFactory FACTORY
protected SAXTransformerFactory factory
protected DOMResult result
protected Node parentNode
protected ContentHandler nextHandler
public DOMBuilder()
public DOMBuilder(SAXTransformerFactory factory)
factory
- the SAX transformer factorypublic DOMBuilder(Node parentNode)
parentNode
- the parent nodepublic DOMBuilder(SAXTransformerFactory factory, Node parentNode)
factory
- the SAX transformer factoryparentNode
- the parent nodepublic Document getDocument()
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
SAXException
public void endElement(String arg0, String arg1, String arg2) throws SAXException
endElement
in interface ContentHandler
SAXException
public void startPrefixMapping(String arg0, String arg1) throws SAXException
startPrefixMapping
in interface ContentHandler
SAXException
public void endPrefixMapping(String arg0) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
public void characters(char[] arg0, int arg1, int arg2) throws SAXException
characters
in interface ContentHandler
SAXException
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException
ignorableWhitespace
in interface ContentHandler
SAXException
public void processingInstruction(String arg0, String arg1) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
public void skippedEntity(String arg0) throws SAXException
skippedEntity
in interface ContentHandler
SAXException
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.