org.apache.xmlbeans.impl.common

## Class Sax2Dom

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.apache.xmlbeans.impl.common.Sax2Dom

- All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

      public class Sax2Dom
      extends DefaultHandler
      implements ContentHandler, LexicalHandler

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EMPTYSTRING`
    `static String` | `XML_PREFIX`
    `static String` | `XMLNS_PREFIX`
    `static String` | `XMLNS_STRING`
    `static String` | `XMLNS_URI`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Sax2Dom()`
    `Sax2Dom(Node root)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `characters(char[] ch, int start, int length)`
    `void` | `comment(char[] ch, int start, int length)` Lexical Handler method to create comment node in DOM tree.
    `void` | `endCDATA()`
    `void` | `endDocument()`
    `void` | `endDTD()`
    `void` | `endElement(String namespace, String localName, String qName)`
    `void` | `endEntity(String name)`
    `void` | `endPrefixMapping(String prefix)`
    `Node` | `getDOM()`
    `void` | `ignorableWhitespace(char[] ch, int start, int length)` This class is only used internally so this method should never be called.
    `void` | `processingInstruction(String target, String data)` adds processing instruction node to DOM.
    `void` | `setDocumentLocator(Locator locator)` This class is only used internally so this method should never be called.
    `void` | `skippedEntity(String name)` This class is only used internally so this method should never be called.
    `void` | `startCDATA()`
    `void` | `startDocument()`
    `void` | `startDTD(String name, String publicId, String systemId)`
    `void` | `startElement(String namespace, String localName, String qName, Attributes attrs)`
    `void` | `startEntity(String name)`
    `void` | `startPrefixMapping(String prefix, String uri)`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning`

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

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

- - ### Field Detail

    - #### EMPTYSTRING

          public static final String EMPTYSTRING

      See Also:
        Constant Field Values

    - #### XML_PREFIX

          public static final String XML_PREFIX

      See Also:
        Constant Field Values

    - #### XMLNS_PREFIX

          public static final String XMLNS_PREFIX

      See Also:
        Constant Field Values

    - #### XMLNS_STRING

          public static final String XMLNS_STRING

      See Also:
        Constant Field Values

    - #### XMLNS_URI

          public static final String XMLNS_URI

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Sax2Dom

          public Sax2Dom()
                  throws ParserConfigurationException

      Throws:
        `ParserConfigurationException`

    - #### Sax2Dom

          public Sax2Dom(Node root)
                  throws ParserConfigurationException

      Throws:
        `ParserConfigurationException`

  - ### Method Detail

    - #### getDOM

          public Node getDOM()

    - #### characters

          public void characters(char[] ch,
                                 int start,
                                 int length)

      Specified by:
        `characters` in interface `ContentHandler`
      Overrides:
        `characters` in class `DefaultHandler`

    - #### startDocument

          public void startDocument()

      Specified by:
        `startDocument` in interface `ContentHandler`
      Overrides:
        `startDocument` in class `DefaultHandler`

    - #### endDocument

          public void endDocument()

      Specified by:
        `endDocument` in interface `ContentHandler`
      Overrides:
        `endDocument` in class `DefaultHandler`

    - #### startElement

          public void startElement(String namespace,
                                   String localName,
                                   String qName,
                                   Attributes attrs)

      Specified by:
        `startElement` in interface `ContentHandler`
      Overrides:
        `startElement` in class `DefaultHandler`

    - #### endElement

          public void endElement(String namespace,
                                 String localName,
                                 String qName)

      Specified by:
        `endElement` in interface `ContentHandler`
      Overrides:
        `endElement` in class `DefaultHandler`

    - #### startPrefixMapping

          public void startPrefixMapping(String prefix,
                                         String uri)

      Specified by:
        `startPrefixMapping` in interface `ContentHandler`
      Overrides:
        `startPrefixMapping` in class `DefaultHandler`

    - #### endPrefixMapping

          public void endPrefixMapping(String prefix)

      Specified by:
        `endPrefixMapping` in interface `ContentHandler`
      Overrides:
        `endPrefixMapping` in class `DefaultHandler`

    - #### ignorableWhitespace

          public void ignorableWhitespace(char[] ch,
                                          int start,
                                          int length)

      This class is only used internally so this method should never be called.
      Specified by:
        `ignorableWhitespace` in interface `ContentHandler`
      Overrides:
        `ignorableWhitespace` in class `DefaultHandler`

    - #### processingInstruction

          public void processingInstruction(String target,
                                            String data)

      adds processing instruction node to DOM.
      Specified by:
        `processingInstruction` in interface `ContentHandler`
      Overrides:
        `processingInstruction` in class `DefaultHandler`

    - #### setDocumentLocator

          public void setDocumentLocator(Locator locator)

      This class is only used internally so this method should never be called.
      Specified by:
        `setDocumentLocator` in interface `ContentHandler`
      Overrides:
        `setDocumentLocator` in class `DefaultHandler`

    - #### skippedEntity

          public void skippedEntity(String name)

      This class is only used internally so this method should never be called.
      Specified by:
        `skippedEntity` in interface `ContentHandler`
      Overrides:
        `skippedEntity` in class `DefaultHandler`

    - #### comment

          public void comment(char[] ch,
                              int start,
                              int length)

      Lexical Handler method to create comment node in DOM tree.
      Specified by:
        `comment` in interface `LexicalHandler`

    - #### startCDATA

          public void startCDATA()

      Specified by:
        `startCDATA` in interface `LexicalHandler`

    - #### endCDATA

          public void endCDATA()

      Specified by:
        `endCDATA` in interface `LexicalHandler`

    - #### startEntity

          public void startEntity(String name)

      Specified by:
        `startEntity` in interface `LexicalHandler`

    - #### endEntity

          public void endEntity(String name)

      Specified by:
        `endEntity` in interface `LexicalHandler`

    - #### startDTD

          public void startDTD(String name,
                               String publicId,
                               String systemId)
                        throws SAXException

      Specified by:
        `startDTD` in interface `LexicalHandler`
      Throws:
        `SAXException`

    - #### endDTD

          public void endDTD()

      Specified by:
        `endDTD` in interface `LexicalHandler`