info.bioinfweb.jphyloio.utils

## Class JPhyloIOWritingUtils

- java.lang.Object
- - info.bioinfweb.jphyloio.utils.JPhyloIOWritingUtils

-     public class JPhyloIOWritingUtils
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JPhyloIOWritingUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `writeCharSequencePartContent(JPhyloIOEventReceiver receiver, long startColumn, long endColumn, java.lang.CharSequence source)`
    `static void` | `writeListSequencePartContent(JPhyloIOEventReceiver receiver, long startColumn, long endColumn, java.util.List<?> source)`
    `static void` | `writeSimpleLiteralMetadata(JPhyloIOEventReceiver receiver, java.lang.String id, java.lang.String label, javax.xml.namespace.QName predicate, javax.xml.namespace.QName originalType, java.lang.Object objectValue)` Writes an event subsequence modeling a literal metadata annotation with a simple value.
    `static void` | `writeSimpleLiteralMetadata(JPhyloIOEventReceiver receiver, java.lang.String id, java.lang.String label, javax.xml.namespace.QName predicate, javax.xml.namespace.QName originalType, java.lang.Object objectValue, java.lang.String stringRepresentation)` Writes an event subsequence modeling a literal metadata annotation with a simple value.
    `static void` | `writeSimpleLiteralMetadata(JPhyloIOEventReceiver receiver, java.lang.String id, java.lang.String label, URIOrStringIdentifier predicate, URIOrStringIdentifier originalType, java.lang.Object objectValue, java.lang.String stringRepresentation)` Writes an event subsequence modeling a literal metadata annotation with a simple value.
    `static void` | `writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver, java.lang.String id, java.lang.String label, javax.xml.namespace.QName rel, java.net.URI hRef)` Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver.
    `static void` | `writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver, java.lang.String id, java.lang.String label, javax.xml.namespace.QName rel, java.net.URI hRef, java.lang.String about)` Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver.
    `static void` | `writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver, java.lang.String id, java.lang.String label, URIOrStringIdentifier rel, java.net.URI hRef)` Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver.
    `static void` | `writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver, java.lang.String id, java.lang.String label, URIOrStringIdentifier rel, java.net.URI hRef, java.lang.String about)` Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver.

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

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

- - ### Constructor Detail

    - #### JPhyloIOWritingUtils

          public JPhyloIOWritingUtils()

  - ### Method Detail

    - #### writeCharSequencePartContent

          public static void writeCharSequencePartContent(JPhyloIOEventReceiver receiver,
                                                          long startColumn,
                                                          long endColumn,
                                                          java.lang.CharSequence source)
                                                   throws java.io.IOException,
                                                          java.lang.IllegalArgumentException

      Throws:
        `java.io.IOException`
        `java.lang.IllegalArgumentException`

    - #### writeListSequencePartContent

          public static void writeListSequencePartContent(JPhyloIOEventReceiver receiver,
                                                          long startColumn,
                                                          long endColumn,
                                                          java.util.List<?> source)
                                                   throws java.io.IOException,
                                                          java.lang.IllegalArgumentException

      Throws:
        `java.io.IOException`
        `java.lang.IllegalArgumentException`

    - #### writeSimpleLiteralMetadata

          public static void writeSimpleLiteralMetadata(JPhyloIOEventReceiver receiver,
                                                        java.lang.String id,
                                                        java.lang.String label,
                                                        URIOrStringIdentifier predicate,
                                                        URIOrStringIdentifier originalType,
                                                        java.lang.Object objectValue,
                                                        java.lang.String stringRepresentation)
                                                 throws java.io.IOException

      Writes an event subsequence modeling a literal metadata annotation with a simple value. The generated content event will have the sequence type `LiteralContentSequenceType.SIMPLE`.

      This tool method can be useful in an application's implementation of a data adapter providing metadata.

      Parameters:
        `receiver` - the event receiver to write the event sequence to
        `id` - the ID of the literal metadata start event to be written
        `label` - the label of the literal metadata start event to be written
        `predicate` - the predicate of the literal metadata start event to be written
        `originalType` - the type of the literal metadata start event to be written
        `objectValue` - the object value of the literal metadata content event to be written
        `stringRepresentation` - the string value of the literal metadata content event to be written
      Throws:
        `java.io.IOException` - if an I/O exception is thrown by `receiver`
      See Also:
        `writeSimpleLiteralMetadata(JPhyloIOEventReceiver, String, String, QName, QName, Object, String)`, `LiteralMetadataEvent`, `LiteralMetadataContentEvent`, `LiteralContentSequenceType.SIMPLE`

    - #### writeSimpleLiteralMetadata

          public static void writeSimpleLiteralMetadata(JPhyloIOEventReceiver receiver,
                                                        java.lang.String id,
                                                        java.lang.String label,
                                                        javax.xml.namespace.QName predicate,
                                                        javax.xml.namespace.QName originalType,
                                                        java.lang.Object objectValue,
                                                        java.lang.String stringRepresentation)
                                                 throws java.io.IOException

      Writes an event subsequence modeling a literal metadata annotation with a simple value. The generated content event will have the sequence type `LiteralContentSequenceType.SIMPLE`. In contrast to `writeSimpleLiteralMetadata(JPhyloIOEventReceiver, String, String, URIOrStringIdentifier, URIOrStringIdentifier, Object, String)` this convenience method accepts `QName`s instead of `URIOrStringIdentifier`s as the predicate and original type and will assume `null` for the respective string keys.

      This tool method can be useful in an application's implementation of a data adapter providing metadata.

      Parameters:
        `receiver` - the event receiver to write the event sequence to
        `id` - the ID of the literal metadata start event to be written
        `label` - the label of the literal metadata start event to be written
        `predicate` - the predicate of the literal metadata start event to be written
        `originalType` - the type of the literal metadata start event to be written
        `objectValue` - the object value of the literal metadata content event to be written
        `stringRepresentation` - the string value of the literal metadata content event to be written
      Throws:
        `java.io.IOException` - if an I/O exception is thrown by `receiver`
      See Also:
        `writeSimpleLiteralMetadata(JPhyloIOEventReceiver, String, String, URIOrStringIdentifier, URIOrStringIdentifier, Object, String)`, `LiteralMetadataEvent`, `LiteralMetadataContentEvent`, `LiteralContentSequenceType.SIMPLE`

    - #### writeSimpleLiteralMetadata

          public static void writeSimpleLiteralMetadata(JPhyloIOEventReceiver receiver,
                                                        java.lang.String id,
                                                        java.lang.String label,
                                                        javax.xml.namespace.QName predicate,
                                                        javax.xml.namespace.QName originalType,
                                                        java.lang.Object objectValue)
                                                 throws java.io.IOException

      Writes an event subsequence modeling a literal metadata annotation with a simple value. The generated content event will have the sequence type `LiteralContentSequenceType.SIMPLE`. In contrast to `writeSimpleLiteralMetadata(JPhyloIOEventReceiver, String, String, URIOrStringIdentifier, URIOrStringIdentifier, Object, String)` this convenience method accepts `QName`s instead of `URIOrStringIdentifier`s as the predicate and original type and will assume `null` for the respective string keys. Compared to `writeSimpleLiteralMetadata(JPhyloIOEventReceiver, String, String, QName, QName, Object, String)` this method also omits the value's string representation and assumes `null` for it.

      This tool method can be useful in an application's implementation of a data adapter providing metadata.

      Parameters:
        `receiver` - the event receiver to write the event sequence to
        `id` - the ID of the literal metadata start event to be written
        `label` - the label of the literal metadata start event to be written
        `predicate` - the predicate of the literal metadata start event to be written
        `originalType` - the type of the literal metadata start event to be written
        `objectValue` - the object value of the literal metadata content event to be written
      Throws:
        `java.io.IOException` - if an I/O exception is thrown by `receiver`
      See Also:
        `writeSimpleLiteralMetadata(JPhyloIOEventReceiver, String, String, URIOrStringIdentifier, URIOrStringIdentifier, Object, String)`, `LiteralMetadataEvent`, `LiteralMetadataContentEvent`, `LiteralContentSequenceType.SIMPLE`

    - #### writeTerminalResourceMetadata

          public static void writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver,
                                                           java.lang.String id,
                                                           java.lang.String label,
                                                           URIOrStringIdentifier rel,
                                                           java.net.URI hRef,
                                                           java.lang.String about)
                                                    throws java.io.IOException

      Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver.
      Parameters:
        `receiver` - the receiver to write the events to
        `id` - the unique ID associated with the represented data element (Must be a valid NCName.)
        `label` - a label associated with the represented data element (Maybe `null`.)
        `rel` - the RDF rel URI of this element
        `hRef` - the RDF hRef URI of this element
        `about` - the content of a specific about attribute to be written on the according XML representation of this element (Maybe `null`.)
      Throws:
        `java.lang.NullPointerException` - if `id` or `rel` are `null`
        `java.lang.IllegalArgumentException` - if the specified ID is not a valid NCName
        `java.io.IOException` - if an I/O error occurs when writing to the specified receiver

    - #### writeTerminalResourceMetadata

          public static void writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver,
                                                           java.lang.String id,
                                                           java.lang.String label,
                                                           URIOrStringIdentifier rel,
                                                           java.net.URI hRef)
                                                    throws java.io.IOException

      Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver.
      Parameters:
        `receiver` - the receiver to write the events to
        `id` - the unique ID associated with the represented data element (Must be a valid NCName.)
        `label` - a label associated with the represented data element (Maybe `null`.)
        `rel` - the RDF rel URI of this element
        `hRef` - the RDF hRef URI of this element
      Throws:
        `java.lang.NullPointerException` - if `id` or `rel` are `null`
        `java.lang.IllegalArgumentException` - if the specified ID is not a valid NCName
        `java.io.IOException` - if an I/O error occurs when writing to the specified receiver

    - #### writeTerminalResourceMetadata

          public static void writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver,
                                                           java.lang.String id,
                                                           java.lang.String label,
                                                           javax.xml.namespace.QName rel,
                                                           java.net.URI hRef,
                                                           java.lang.String about)
                                                    throws java.io.IOException

      Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver. The string representations of `rel` will be set to `null`.
      Parameters:
        `receiver` - the receiver to write the events to
        `id` - the unique ID associated with the represented data element (Must be a valid NCName.)
        `label` - a label associated with the represented data element (Maybe `null`.)
        `rel` - the RDF rel URI of this element
        `hRef` - the RDF hRef URI of this element
        `about` - the content of a specific about attribute to be written on the according XML representation of this element (Maybe `null`.)
      Throws:
        `java.lang.NullPointerException` - if `id` or `rel` are `null`
        `java.lang.IllegalArgumentException` - if the specified ID is not a valid NCName
        `java.io.IOException` - if an I/O error occurs when writing to the specified receiver

    - #### writeTerminalResourceMetadata

          public static void writeTerminalResourceMetadata(JPhyloIOEventReceiver receiver,
                                                           java.lang.String id,
                                                           java.lang.String label,
                                                           javax.xml.namespace.QName rel,
                                                           java.net.URI hRef)
                                                    throws java.io.IOException

      Writes a `ResourceMetadataEvent` and its respective end event to the specified receiver. The string representations of `rel` will be set to `null`.
      Parameters:
        `receiver` - the receiver to write the events to
        `id` - the unique ID associated with the represented data element (Must be a valid NCName.)
        `label` - a label associated with the represented data element (Maybe `null`.)
        `rel` - the RDF rel URI of this element
        `hRef` - the RDF hRef URI of this element
      Throws:
        `java.lang.NullPointerException` - if `id` or `rel` are `null`
        `java.lang.IllegalArgumentException` - if the specified ID is not a valid NCName
        `java.io.IOException` - if an I/O error occurs when writing to the specified receiver