Package org.apache.struts2.util
Class DomHelper.DOMBuilder
java.lang.Object
org.apache.struts2.util.DomHelper.DOMBuilder
- All Implemented Interfaces:
ContentHandler
- Enclosing class:
- DomHelper
The
DOMBuilder
is a utility class that will generate a W3C
DOM Document from SAX events.- Author:
- Carsten Ziegeler
-
Field Summary
Modifier and TypeFieldDescriptionprotected SAXTransformerFactory
The transformer factoryprotected static SAXTransformerFactory
The default transformer factory shared by all instancesprotected ContentHandler
protected Node
The parentNodeprotected DOMResult
The result -
Constructor Summary
ConstructorDescriptionConstruct a new instance of this DOMBuilder.DOMBuilder
(SAXTransformerFactory factory) Construct a new instance of this DOMBuilder.DOMBuilder
(SAXTransformerFactory factory, Node parentNode) Construct a new instance of this DOMBuilder.DOMBuilder
(Node parentNode) Constructs a new instance that appends nodes to the given parent node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] arg0, int arg1, int arg2) void
void
endElement
(String arg0, String arg1, String arg2) void
endPrefixMapping
(String arg0) 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
void
startElement
(String uri, String loc, String raw, Attributes attrs) void
startPrefixMapping
(String arg0, String arg1) 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
-
FACTORY
The default transformer factory shared by all instances -
factory
The transformer factory -
result
The result -
parentNode
The parentNode -
nextHandler
-
-
Constructor Details
-
DOMBuilder
public DOMBuilder()Construct a new instance of this DOMBuilder. -
DOMBuilder
Construct a new instance of this DOMBuilder.- Parameters:
factory
- the SAX transformer factory
-
DOMBuilder
Constructs a new instance that appends nodes to the given parent node.- Parameters:
parentNode
- the parent node
-
DOMBuilder
Construct a new instance of this DOMBuilder.- Parameters:
factory
- the SAX transformer factoryparentNode
- the parent node
-
-
Method Details
-
getDocument
Return the newly built Document.- Returns:
- the W3C Document
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startElement
- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-