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
FieldsModifier and TypeFieldDescriptionprotected SAXTransformerFactoryThe transformer factoryprotected static SAXTransformerFactoryThe default transformer factory shared by all instancesprotected ContentHandlerprotected NodeThe parentNodeprotected DOMResultThe result -
Constructor Summary
ConstructorsConstructorDescriptionConstruct 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 TypeMethodDescriptionvoidcharacters(char[] arg0, int arg1, int arg2) voidvoidendElement(String arg0, String arg1, String arg2) voidendPrefixMapping(String arg0) Return the newly built Document.voidignorableWhitespace(char[] arg0, int arg1, int arg2) voidprocessingInstruction(String arg0, String arg1) voidsetDocumentLocator(Locator locator) voidskippedEntity(String arg0) voidvoidstartElement(String uri, String loc, String raw, Attributes attrs) voidstartPrefixMapping(String arg0, String arg1) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
setDocumentLocatorin interfaceContentHandler
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-