com.opensymphony.xwork2.util

## Class DomHelper.DOMBuilder

- java.lang.Object
- - com.opensymphony.xwork2.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 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 Summary

    Constructors
    Constructor and Description
    `DomHelper.DOMBuilder()` Construct a new instance of this DOMBuilder.
    `DomHelper.DOMBuilder(Node parentNode)` Constructs a new instance that appends nodes to the given parent node.
    `DomHelper.DOMBuilder(SAXTransformerFactory factory)` Construct a new instance of this DOMBuilder.
    `DomHelper.DOMBuilder(SAXTransformerFactory factory, Node parentNode)` Construct a new instance of this DOMBuilder.

  - ### Method Summary

    Methods
    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)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

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

    - #### DomHelper.DOMBuilder

          public DomHelper.DOMBuilder()

      Construct a new instance of this DOMBuilder.

    - #### DomHelper.DOMBuilder

          public DomHelper.DOMBuilder(SAXTransformerFactory factory)

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

    - #### DomHelper.DOMBuilder

          public DomHelper.DOMBuilder(Node parentNode)

      Constructs a new instance that appends nodes to the given parent node.
      Parameters:
        `parentNode` - the parent node

    - #### DomHelper.DOMBuilder

          public DomHelper.DOMBuilder(SAXTransformerFactory factory,
                              Node parentNode)

      Construct a new instance of this DOMBuilder.
      Parameters:
        `factory` - the SAX transformer factory
        `parentNode` - the parent node

  - ### Method Detail

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

Copyright © 2000–2019 Apache Software Foundation. All rights reserved.