info.bioinfweb.jphyloio.formats.xml

## Interface JPhyloIOXMLEventWriter

- All Superinterfaces:
    JPhyloIOEventWriter, JPhyloIOFormatSpecificObject
  All Known Implementing Classes:
    AbstractXMLEventWriter, NeXMLEventWriter, PhyloXMLEventWriter

      public interface JPhyloIOXMLEventWriter
      extends JPhyloIOEventWriter

  Interface providing basic functionality for all JPhyloIO writers of XML formats. Note, that these writers are able to change the prefix a namespace is bound to. Therefore it is important that applications writing prefixes in attributes or character data always use the provided namespace context object to obtain the prefix a namespace is currently bound to.
  Author:
    Sarah Wiechers, Ben Stöver

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.xml.stream.XMLEventWriter` | `createMetaXMLEventWriter(JPhyloIOEventReceiver receiver)` Creates a new `XMLEventWriter` that allows to write events of XML content of literal metadata to this JPhyloIO event writer instance through that interface.
    `javax.xml.stream.XMLStreamWriter` | `createMetaXMLStreamWriter(JPhyloIOEventReceiver receiver)` Creates a new `XMLStreamWriter` that allows to write events of XML content of literal metadata to this JPhyloIO event writer instance through that interface.
    `javax.xml.namespace.NamespaceContext` | `getNamespaceContext()` Returns the currently valid namespace context of the writer.

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

      `writeDocument, writeDocument, writeDocument`

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

      `getFormatID`

- - ### Method Detail

    - #### getNamespaceContext

          javax.xml.namespace.NamespaceContext getNamespaceContext()

      Returns the currently valid namespace context of the writer.
      Returns:
        the currently valid `NamespaceContext` object

    - #### createMetaXMLEventWriter

          javax.xml.stream.XMLEventWriter createMetaXMLEventWriter(JPhyloIOEventReceiver receiver)
                                                            throws java.lang.IllegalStateException

      Creates a new `XMLEventWriter` that allows to write events of XML content of literal metadata to this JPhyloIO event writer 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 writer instances delegating to the same JPhyloIO reader, although that is not recommended.

      In implementations of this interface that are part of JPhyloIO, the returned writer is an instance of `MetaXMLEventWriter`. You can have a look at its documentation for furthter details in how the returned instance behaves. (Note that third party implementations might return a different implementation of `XMLEventWriter` here.)

      Parameters:
        `receiver` - the receiver to write events to (Each `XMLEvent` will be translated into a `LiteralMetadataContentEvent`.)
      Returns:
        the new writer instance
      Throws:
        `java.lang.IllegalStateException` - if no writer can be created at the current position (outside of a literal metadata event subsequence with type `LiteralContentSequenceType.XML`)

    - #### createMetaXMLStreamWriter

          javax.xml.stream.XMLStreamWriter createMetaXMLStreamWriter(JPhyloIOEventReceiver receiver)
                                                              throws java.lang.IllegalStateException

      Creates a new `XMLStreamWriter` that allows to write events of XML content of literal metadata to this JPhyloIO event writer 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 theory this method may be called multiple times within the same literal metadata event subsequence, which would result in having multiple XML event writer instances delegating to the same JPhyloIO reader, although that is not recommended.

      In implementations of this interface that are part of JPhyloIO, the returned writer is an instance of `MetaXMLStreamWriter`. You can have a look at its documentation for furthter details in how the returned instance behaves. (Note that third party implementations might return a different implementation of `XMLStreamWriter` here.)

      Parameters:
        `receiver` - the receiver to write events to (Each writing operation will be translated into a `LiteralMetadataContentEvent`.)
      Returns:
        the new writer instance
      Throws:
        `java.lang.IllegalStateException` - if no writer can be created at the current position (outside of a literal metadata event subsequence with type `LiteralContentSequenceType.XML`)