Package org.apache.synapse.commons.staxon.core.util

## Class DOMEventConsumer

- java.lang.Object
- - org.apache.synapse.commons.staxon.core.util.DOMEventConsumer

- All Implemented Interfaces:
    `XMLEventConsumer`

      public class DOMEventConsumer
      extends Object
      implements XMLEventConsumer

  DOM event consumer.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DOMEventConsumer​(Node node)` | Create namespace-aware consumer instance.
    `DOMEventConsumer​(Node node, boolean namespaceAware)` | Create consumer instance.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `add​(XMLEvent event)` |
    `void` | `add​(XMLEventReader reader)` | Add all events from the given reader.
    `static Document` | `consume​(XMLEventReader reader)` | This method will create and populate a `Document` from the given event reader.
    `static Document` | `consume​(XMLEventReader reader, DocumentBuilder documentBuilder)` | This method will create and populate a `Document` from the given event reader.
    `static void` | `consume​(XMLEventReader reader, Node node)` | This method will populate given `Node` from the given event reader.

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

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

- - ### Constructor Detail

    - #### DOMEventConsumer

          public DOMEventConsumer​(Node node)

      Create namespace-aware consumer instance.
      Parameters:
        `node` - the node to which events will be appended

    - #### DOMEventConsumer

          public DOMEventConsumer​(Node node,
                                  boolean namespaceAware)

      Create consumer instance.
      Parameters:
        `node` - the node to which events will be appended
        `namespaceAware` - whether the DOM will be namespace-aware

  - ### Method Detail

    - #### add

          public void add​(XMLEvent event)
                   throws XMLStreamException

      Specified by:
        `add` in interface `XMLEventConsumer`
      Throws:
        `XMLStreamException`

    - #### add

          public void add​(XMLEventReader reader)
                   throws XMLStreamException

      Add all events from the given reader.
      Parameters:
        `reader` -
      Throws:
        `XMLStreamException`

    - #### consume

          public static Document consume​(XMLEventReader reader)
                                  throws XMLStreamException

      This method will create and populate a `Document` from the given event reader.
      Parameters:
        `reader` - event reader
      Returns:
        document
      Throws:
        `XMLStreamException`

    - #### consume

          public static Document consume​(XMLEventReader reader,
                                         DocumentBuilder documentBuilder)
                                  throws XMLStreamException

      This method will create and populate a `Document` from the given event reader.
      Parameters:
        `reader` - event reader
        `documentBuilder` -
      Returns:
        document
      Throws:
        `XMLStreamException`

    - #### consume

          public static void consume​(XMLEventReader reader,
                                     Node node)
                              throws XMLStreamException

      This method will populate given `Node` from the given event reader.
      Parameters:
        `reader` - event reader
        `node` - parent node
      Throws:
        `XMLStreamException`