info.bioinfweb.jphyloio.formats.xml.stax

## Class AbstractMetaXMLReader

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

- Direct Known Subclasses:
    MetaXMLEventReader, MetaXMLStreamReader

      public abstract class AbstractMetaXMLReader
      extends java.lang.Object

  Implements shared functionality for custom XML readers.

  Each created reader instance will create their own start and end document events. If multiple instances are used for the same literal meta subsequence this can lead to multiple start and end document events being generated. However, start document events are only created if no literal content event was consumed yet.

  Author:
    Sarah Wiechers

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractMetaXMLReader(XMLReaderStreamDataProvider<?> streamDataProvider)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` This method has no effect in this reader.
    `protected javax.xml.stream.XMLEventFactory` | `getEventFactory()`
    `protected JPhyloIOXMLEventReader` | `getJPhyloIOEventReader()`
    `java.lang.Object` | `getProperty(java.lang.String name)`
    `protected XMLReaderStreamDataProvider<?>` | `getStreamDataProvider()`
    `boolean` | `hasNext()`
    `protected boolean` | `isEndDocumentFired()`
    `protected boolean` | `isEndReached()`
    `protected boolean` | `isStartDocumentFired()`
    `protected javax.xml.stream.events.XMLEvent` | `obtainXMLContentEvent(JPhyloIOEvent jPhyloIOEvent)`
    `protected void` | `setEndDocumentFired(boolean endDocumentFired)`
    `protected void` | `setEndReached()`
    `protected void` | `setStartDocumentFired(boolean startDocumentFired)`

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

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

- - ### Constructor Detail

    - #### AbstractMetaXMLReader

          public AbstractMetaXMLReader(XMLReaderStreamDataProvider<?> streamDataProvider)

  - ### Method Detail

    - #### setEndReached

          protected void setEndReached()

    - #### getJPhyloIOEventReader

          protected JPhyloIOXMLEventReader getJPhyloIOEventReader()

    - #### getStreamDataProvider

          protected XMLReaderStreamDataProvider<?> getStreamDataProvider()

    - #### getEventFactory

          protected javax.xml.stream.XMLEventFactory getEventFactory()

    - #### isEndReached

          protected boolean isEndReached()

    - #### isStartDocumentFired

          protected boolean isStartDocumentFired()

    - #### setStartDocumentFired

          protected void setStartDocumentFired(boolean startDocumentFired)

    - #### isEndDocumentFired

          protected boolean isEndDocumentFired()

    - #### setEndDocumentFired

          protected void setEndDocumentFired(boolean endDocumentFired)

    - #### close

          public void close()
                     throws javax.xml.stream.XMLStreamException

      This method has no effect in this reader. Both the JPhyloIO and the XML event stream will still be open, if they were before calling this method. Freeing resources of this reader is not necessary, since it just delegates to another reader.
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### hasNext

          public boolean hasNext()

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String name)
                                       throws java.lang.IllegalArgumentException

      Throws:
        `java.lang.IllegalArgumentException`

    - #### obtainXMLContentEvent

          protected javax.xml.stream.events.XMLEvent obtainXMLContentEvent(JPhyloIOEvent jPhyloIOEvent)
                                                                    throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`