info.bioinfweb.jphyloio.formats.xml.stax

## Class MetaXMLEventReader

- java.lang.Object
- - info.bioinfweb.jphyloio.formats.xml.stax.AbstractMetaXMLReader
  - - info.bioinfweb.jphyloio.formats.xml.stax.MetaXMLEventReader

- All Implemented Interfaces:
    java.util.Iterator, javax.xml.stream.XMLEventReader

      public class MetaXMLEventReader
      extends AbstractMetaXMLReader
      implements javax.xml.stream.XMLEventReader

  Adapter class that allows reading a sequence of `LiteralMetadataContentEvent`s using an `XMLEventReader`. Instances of this class should not (and cannot) be created directly in application code, but `JPhyloIOXMLEventReader.createMetaXMLEventReader()` should be used instead.

  Since it is registered which events are read from the event stream, it is possible to read only a part of the custom XML tree with this reader, while the rest is read using the original `JPhyloIOEventReader`.

  Author:
    Ben Stöver, Sarah Wiechers

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetaXMLEventReader(XMLReaderStreamDataProvider<?> streamDataProvider)` Creates a new instance of this class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getElementText()`
    `java.lang.Object` | `next()`
    `javax.xml.stream.events.XMLEvent` | `nextEvent()`
    `javax.xml.stream.events.XMLEvent` | `nextTag()`
    `javax.xml.stream.events.XMLEvent` | `peek()`
    `void` | `remove()`

    - ### Methods inherited from class info.bioinfweb.jphyloio.formats.xml.stax.AbstractMetaXMLReader

      `close, getEventFactory, getJPhyloIOEventReader, getProperty, getStreamDataProvider, hasNext, isEndDocumentFired, isEndReached, isStartDocumentFired, obtainXMLContentEvent, setEndDocumentFired, setEndReached, setStartDocumentFired`

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

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

    - ### Methods inherited from interface javax.xml.stream.XMLEventReader

      `close, getProperty, hasNext`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Constructor Detail

    - #### MetaXMLEventReader

          public MetaXMLEventReader(XMLReaderStreamDataProvider<?> streamDataProvider)

      Creates a new instance of this class. Application code should not use this constructor directly, but use `JPhyloIOXMLEventReader.createMetaXMLEventReader()` instead.
      Parameters:
        `streamDataProvider` - the stream data provider of the underlying `JPhyloIOEventReader`

  - ### Method Detail

    - #### next

          public java.lang.Object next()
                                throws java.util.NoSuchElementException

      Specified by:
        `next` in interface `java.util.Iterator`
      Throws:
        `java.util.NoSuchElementException`

    - #### remove

          public void remove()
                      throws java.lang.UnsupportedOperationException

      Specified by:
        `remove` in interface `java.util.Iterator`
      Throws:
        `java.lang.UnsupportedOperationException`

    - #### getElementText

          public java.lang.String getElementText()
                                          throws javax.xml.stream.XMLStreamException

      Specified by:
        `getElementText` in interface `javax.xml.stream.XMLEventReader`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### nextEvent

          public javax.xml.stream.events.XMLEvent nextEvent()
                                                     throws javax.xml.stream.XMLStreamException

      Specified by:
        `nextEvent` in interface `javax.xml.stream.XMLEventReader`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### nextTag

          public javax.xml.stream.events.XMLEvent nextTag()
                                                   throws javax.xml.stream.XMLStreamException

      Specified by:
        `nextTag` in interface `javax.xml.stream.XMLEventReader`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### peek

          public javax.xml.stream.events.XMLEvent peek()
                                                throws javax.xml.stream.XMLStreamException

      Specified by:
        `peek` in interface `javax.xml.stream.XMLEventReader`
      Throws:
        `javax.xml.stream.XMLStreamException`