Package org.apache.struts2.util

# Class DomHelper.DOMBuilder

java.lang.Object
org.apache.struts2.util.DomHelper.DOMBuilder

All Implemented Interfaces:
  `ContentHandler`

Enclosing class:
  DomHelper

public static class DomHelper.DOMBuilder extends Object implements ContentHandler
The `DOMBuilder` is a utility class that will generate a W3C DOM Document from SAX events.

Author:
  Carsten Ziegeler

- ## Field Summary

  Fields
  Modifier and Type
  Field
  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 Summary

  Constructors
  Constructor
  Description
  `DOMBuilder()`
  Construct 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 Type
  Method
  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)`

  ### 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

    protected static SAXTransformerFactory FACTORY
    The default transformer factory shared by all instances

  - ### factory

    protected SAXTransformerFactory factory
    The transformer factory

  - ### result

    protected DOMResult result
    The result

  - ### parentNode

    protected Node parentNode
    The parentNode

  - ### nextHandler

    protected ContentHandler nextHandler

- ## Constructor Details

  - ### DOMBuilder

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

  - ### DOMBuilder

    public DOMBuilder(SAXTransformerFactory factory)
    Construct a new instance of this DOMBuilder.
    Parameters:
      `factory` - the SAX transformer factory

  - ### DOMBuilder

    public DOMBuilder(Node parentNode)
    Constructs a new instance that appends nodes to the given parent node.
    Parameters:
      `parentNode` - the parent node

  - ### DOMBuilder

    public DOMBuilder(SAXTransformerFactory factory, Node parentNode)
    Construct a new instance of this DOMBuilder.
    Parameters:
      `factory` - the SAX transformer factory
      `parentNode` - the parent node

- ## Method Details

  - ### getDocument

    public Document getDocument()
    Return the newly built Document.
    Returns:
      the W3C Document

  - ### setDocumentLocator

    public void setDocumentLocator(Locator locator)
    Specified by:
      `setDocumentLocator` in interface `ContentHandler`

  - ### startDocument

    public void startDocument() throws SAXException
    Specified by:
      `startDocument` in interface `ContentHandler`
    Throws:
      `SAXException`

  - ### endDocument

    public void endDocument() throws SAXException
    Specified by:
      `endDocument` in interface `ContentHandler`
    Throws:
      `SAXException`

  - ### startElement

    public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
    Specified by:
      `startElement` in interface `ContentHandler`
    Throws:
      `SAXException`

  - ### endElement

    public void endElement(String arg0, String arg1, String arg2) throws SAXException
    Specified by:
      `endElement` in interface `ContentHandler`
    Throws:
      `SAXException`

  - ### startPrefixMapping

    public void startPrefixMapping(String arg0, String arg1) throws SAXException
    Specified by:
      `startPrefixMapping` in interface `ContentHandler`
    Throws:
      `SAXException`

  - ### endPrefixMapping

    public void endPrefixMapping(String arg0) throws SAXException
    Specified by:
      `endPrefixMapping` in interface `ContentHandler`
    Throws:
      `SAXException`

  - ### characters

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

  - ### ignorableWhitespace

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

  - ### processingInstruction

    public void processingInstruction(String arg0, String arg1) throws SAXException
    Specified by:
      `processingInstruction` in interface `ContentHandler`
    Throws:
      `SAXException`

  - ### skippedEntity

    public void skippedEntity(String arg0) throws SAXException
    Specified by:
      `skippedEntity` in interface `ContentHandler`
    Throws:
      `SAXException`