Package tigase.xml

## Class DomBuilderHandler

- java.lang.Object
- - tigase.xml.DomBuilderHandler

- All Implemented Interfaces:
    `SimpleHandler`

      public class DomBuilderHandler
      extends java.lang.Object
      implements SimpleHandler

  `DomBuilderHandler` - implementation of `SimpleHandler` building DOM strctures during parsing time. It also supports creation multiple, sperate document trees if parsed buffer contains a few XML documents. As a result of work it returns always `Queue` containing all found XML trees in the same order as they were found in network data.
  Document trees created by this DOM builder consist of instances of `Element` class or instances of class extending `Element` class. To receive trees built with instances of proper class user must provide `ElementFactory` implementation creating instances of required `ELement` extension.

  Created: Sat Oct 2 22:01:34 2004

  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DomBuilderHandler()` |
    `DomBuilderHandler​(ElementFactory factory)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `elementCData​(java.lang.StringBuilder cdata)` |
    `boolean` | `endElement​(java.lang.StringBuilder name)` |
    `void` | `error​(java.lang.String errorMessage)` |
    `java.util.Queue<Element>` | `getParsedElements()` |
    `void` | `otherXML​(java.lang.StringBuilder other)` |
    `java.lang.Object` | `restoreParserState()` |
    `void` | `saveParserState​(java.lang.Object state)` |
    `void` | `startElement​(java.lang.StringBuilder name, java.lang.StringBuilder[] attr_names, java.lang.StringBuilder[] attr_values)` |

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

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

- - ### Constructor Detail

    - #### DomBuilderHandler

          public DomBuilderHandler​(ElementFactory factory)

    - #### DomBuilderHandler

          public DomBuilderHandler()

  - ### Method Detail

    - #### getParsedElements

          public java.util.Queue<Element> getParsedElements()

    - #### error

          public void error​(java.lang.String errorMessage)

      Specified by:
        `error` in interface `SimpleHandler`

    - #### startElement

          public void startElement​(java.lang.StringBuilder name,
                                   java.lang.StringBuilder[] attr_names,
                                   java.lang.StringBuilder[] attr_values)

      Specified by:
        `startElement` in interface `SimpleHandler`

    - #### elementCData

          public void elementCData​(java.lang.StringBuilder cdata)

      Specified by:
        `elementCData` in interface `SimpleHandler`

    - #### endElement

          public boolean endElement​(java.lang.StringBuilder name)

      Specified by:
        `endElement` in interface `SimpleHandler`

    - #### otherXML

          public void otherXML​(java.lang.StringBuilder other)

      Specified by:
        `otherXML` in interface `SimpleHandler`

    - #### saveParserState

          public void saveParserState​(java.lang.Object state)

      Specified by:
        `saveParserState` in interface `SimpleHandler`

    - #### restoreParserState

          public java.lang.Object restoreParserState()

      Specified by:
        `restoreParserState` in interface `SimpleHandler`