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

## Class DOMEventConsumer

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

- All Implemented Interfaces:
    javax.xml.stream.util.XMLEventConsumer

      public class DOMEventConsumer
      extends java.lang.Object
      implements javax.xml.stream.util.XMLEventConsumer

  DOM event consumer.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DOMEventConsumer(org.w3c.dom.Node node)` Create namespace-aware consumer instance.
    `DOMEventConsumer(org.w3c.dom.Node node, boolean namespaceAware)` Create consumer instance.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(javax.xml.stream.events.XMLEvent event)`
    `void` | `add(javax.xml.stream.XMLEventReader reader)` Add all events from the given reader.
    `static org.w3c.dom.Document` | `consume(javax.xml.stream.XMLEventReader reader)` This method will create and populate a `Document` from the given event reader.
    `static org.w3c.dom.Document` | `consume(javax.xml.stream.XMLEventReader reader, javax.xml.parsers.DocumentBuilder documentBuilder)` This method will create and populate a `Document` from the given event reader.
    `static void` | `consume(javax.xml.stream.XMLEventReader reader, org.w3c.dom.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(org.w3c.dom.Node node)

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

    - #### DOMEventConsumer

          public DOMEventConsumer(org.w3c.dom.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(javax.xml.stream.events.XMLEvent event)
                   throws javax.xml.stream.XMLStreamException

      Specified by:
        `add` in interface `javax.xml.stream.util.XMLEventConsumer`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### add

          public void add(javax.xml.stream.XMLEventReader reader)
                   throws javax.xml.stream.XMLStreamException

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

    - #### consume

          public static org.w3c.dom.Document consume(javax.xml.stream.XMLEventReader reader)
                                              throws javax.xml.stream.XMLStreamException

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

    - #### consume

          public static org.w3c.dom.Document consume(javax.xml.stream.XMLEventReader reader,
                                                     javax.xml.parsers.DocumentBuilder documentBuilder)
                                              throws javax.xml.stream.XMLStreamException

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

    - #### consume

          public static void consume(javax.xml.stream.XMLEventReader reader,
                                     org.w3c.dom.Node node)
                              throws javax.xml.stream.XMLStreamException

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

Copyright © 2005-2020 Apache Software Foundation. All Rights Reserved.