info.bioinfweb.jphyloio.formats.xml

## Interface JPhyloIOXMLEventReader

- All Superinterfaces:
    JPhyloIOEventReader, JPhyloIOFormatSpecificObject
  All Known Implementing Classes:
    AbstractXMLEventReader, NeXMLEventReader, PDEEventReader, PhyloXMLEventReader, XTGEventReader

      public interface JPhyloIOXMLEventReader
      extends JPhyloIOEventReader

  Interface providing basic functionality for all JPhyloIO readers of XML formats.
  Author:
    Sarah Wiechers, Ben Stöver

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.xml.stream.XMLEventReader` | `createMetaXMLEventReader()` Creates a new `XMLEventReader` that allows to read events of XML content of literal metadata from this JPhyloIO event reader instance through that interface.
    `javax.xml.stream.XMLStreamReader` | `createMetaXMLStreamReader()` Creates a `XMLStreamReader` that allows to read events of XML content of literal metadata from this JPhyloIO event reader instance through that interface.
    `javax.xml.namespace.NamespaceContext` | `getNamespaceContext()` Returns the namespace context that is valid at the current position of the document.

    - ### Methods inherited from interface info.bioinfweb.jphyloio.JPhyloIOEventReader

      `addEventListener, close, getLastNonCommentEvent, getParentInformation, getPreviousEvent, hasNextEvent, next, nextOfType, peek, removeEventListener`

    - ### Methods inherited from interface info.bioinfweb.jphyloio.JPhyloIOFormatSpecificObject

      `getFormatID`

- - ### Method Detail

    - #### getNamespaceContext

          javax.xml.namespace.NamespaceContext getNamespaceContext()

      Returns the namespace context that is valid at the current position of the document. The returned value therefore may change with each call of `JPhyloIOEventReader.next()`.

      Applications can use this namespace context e.g. to handle custom XML in literal meta events. In such cases, the according context object should be requested (and saved if necessary) before the next call of `JPhyloIOEventReader.next()`, because prefix to namespace mapping may already change by reading the data for the next event.

      Returns:
        the current namespace context object or `null` if the reader did not encounter the first XML tag of the document yet

    - #### createMetaXMLEventReader

          javax.xml.stream.XMLEventReader createMetaXMLEventReader()
                                                            throws java.lang.IllegalStateException

      Creates a new `XMLEventReader` that allows to read events of XML content of literal metadata from this JPhyloIO event reader instance through that interface. Instances can be created any time, while this instance is located inside a literal metadata subsequence with the `LiteralContentSequenceType.XML`, but not outside of such a sequence.

      In principle this method may be called multiple times within the same literal metadata event subsequence, which would result in having multiple XML event reader instances delegating to the same JPhyloIO reader, although that is not recommended for performance reasons.

      Returns:
        the new reader instance
      Throws:
        `java.lang.IllegalStateException` - if no reader can be created at the current position (outside of a literal metadata event subsequence with type `LiteralContentSequenceType.XML`)

    - #### createMetaXMLStreamReader

          javax.xml.stream.XMLStreamReader createMetaXMLStreamReader()
                                                              throws java.lang.IllegalStateException

      Creates a `XMLStreamReader` that allows to read events of XML content of literal metadata from this JPhyloIO event reader instance through that interface. Instances can be created any time, while this instance is located inside a literal metadata subsequence with the `LiteralContentSequenceType.XML`, but not outside of such a sequence.

      In principle this method may be called multiple times within the same literal metadata event subsequence, which would result in having multiple XML event reader instances delegating to the same JPhyloIO reader, although that is not recommended for performance reasons.

      Returns:
        the new reader instance
      Throws:
        `java.lang.IllegalStateException` - if no reader can be created at the current position (outside of a literal metadata event subsequence with type `LiteralContentSequenceType.XML`)