com.opensymphony.xwork2.util
Class DomHelper.DOMBuilder

java.lang.Object
  extended by com.opensymphony.xwork2.util.DomHelper.DOMBuilder
All Implemented Interfaces:
org.xml.sax.ContentHandler
Enclosing class:
DomHelper

public static class DomHelper.DOMBuilder
extends java.lang.Object
implements org.xml.sax.ContentHandler

The DOMBuilder is a utility class that will generate a W3C DOM Document from SAX events.

Author:
Carsten Ziegeler

Field Summary
protected  javax.xml.transform.sax.SAXTransformerFactory factory
          The transformer factory
protected static javax.xml.transform.sax.SAXTransformerFactory FACTORY
          The default transformer factory shared by all instances
protected  org.xml.sax.ContentHandler nextHandler
           
protected  org.w3c.dom.Node parentNode
          The parentNode
protected  javax.xml.transform.dom.DOMResult result
          The result
 
Constructor Summary
DomHelper.DOMBuilder()
          Construct a new instance of this DOMBuilder.
DomHelper.DOMBuilder(org.w3c.dom.Node parentNode)
          Constructs a new instance that appends nodes to the given parent node.
DomHelper.DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory)
          Construct a new instance of this DOMBuilder.
DomHelper.DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory, org.w3c.dom.Node parentNode)
          Construct a new instance of this DOMBuilder.
 
Method Summary
 void characters(char[] arg0, int arg1, int arg2)
           
 void endDocument()
           
 void endElement(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
           
 void endPrefixMapping(java.lang.String arg0)
           
 org.w3c.dom.Document getDocument()
          Return the newly built Document.
 void ignorableWhitespace(char[] arg0, int arg1, int arg2)
           
 void processingInstruction(java.lang.String arg0, java.lang.String arg1)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void skippedEntity(java.lang.String arg0)
           
 void startDocument()
           
 void startElement(java.lang.String uri, java.lang.String loc, java.lang.String raw, org.xml.sax.Attributes attrs)
           
 void startPrefixMapping(java.lang.String arg0, java.lang.String arg1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY

protected static javax.xml.transform.sax.SAXTransformerFactory FACTORY
The default transformer factory shared by all instances


factory

protected javax.xml.transform.sax.SAXTransformerFactory factory
The transformer factory


result

protected javax.xml.transform.dom.DOMResult result
The result


parentNode

protected org.w3c.dom.Node parentNode
The parentNode


nextHandler

protected org.xml.sax.ContentHandler nextHandler
Constructor Detail

DomHelper.DOMBuilder

public DomHelper.DOMBuilder()
Construct a new instance of this DOMBuilder.


DomHelper.DOMBuilder

public DomHelper.DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory)
Construct a new instance of this DOMBuilder.


DomHelper.DOMBuilder

public DomHelper.DOMBuilder(org.w3c.dom.Node parentNode)
Constructs a new instance that appends nodes to the given parent node.


DomHelper.DOMBuilder

public DomHelper.DOMBuilder(javax.xml.transform.sax.SAXTransformerFactory factory,
                            org.w3c.dom.Node parentNode)
Construct a new instance of this DOMBuilder.

Method Detail

getDocument

public org.w3c.dom.Document getDocument()
Return the newly built Document.


setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String loc,
                         java.lang.String raw,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String arg0,
                       java.lang.String arg1,
                       java.lang.String arg2)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String arg0,
                               java.lang.String arg1)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String arg0)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] arg0,
                       int arg1,
                       int arg2)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] arg0,
                                int arg1,
                                int arg2)
                         throws org.xml.sax.SAXException
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String arg0,
                                  java.lang.String arg1)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

skippedEntity

public void skippedEntity(java.lang.String arg0)
                   throws org.xml.sax.SAXException
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.