Package com.io7m.smfj.format.text

## Class SMFFormatText

- java.lang.Object
- - com.io7m.smfj.format.text.SMFFormatText

- All Implemented Interfaces:
    `SMFParserProviderType`, `SMFVersionProbeProviderType`, `SMFSerializerProviderType`

      public final class SMFFormatText
      extends java.lang.Object
      implements SMFParserProviderType, SMFSerializerProviderType, SMFVersionProbeProviderType

  The implementation of the text format.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SMFFormatText()` | Construct a text format provider.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SMFParserRandomAccessType` | `parserCreateRandomAccess​(SMFParserEventsType events, java.net.URI uri, java.nio.channels.FileChannel file)` |
    `SMFParserSequentialType` | `parserCreateSequential​(SMFParserEventsType in_events, java.net.URI in_uri, java.io.InputStream in_stream)` |
    `SMFFormatDescription` | `parserFormat()` |
    `java.util.SortedSet<SMFFormatVersion>` | `parserSupportedVersions()` |
    `SMFPartialLogged<SMFVersionProbed>` | `probe​(java.io.InputStream stream)` | Attempt to probe the given file stream.
    `SMFSerializerType` | `serializerCreate​(SMFFormatVersion version, java.net.URI uri, java.io.OutputStream stream)` |
    `SMFFormatDescription` | `serializerFormat()` |
    `java.util.SortedSet<SMFFormatVersion>` | `serializerSupportedVersions()` |
    `java.lang.String` | `toString()` |

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

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

- - ### Constructor Detail

    - #### SMFFormatText

          public SMFFormatText()

      Construct a text format provider.

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### parserFormat

          public SMFFormatDescription parserFormat()

      Specified by:
        `parserFormat` in interface `SMFParserProviderType`
      Returns:
        The format that this provider supports

    - #### parserSupportedVersions

          public java.util.SortedSet<SMFFormatVersion> parserSupportedVersions()

      Specified by:
        `parserSupportedVersions` in interface `SMFParserProviderType`
      Returns:
        The supported versions of the format

    - #### parserCreateSequential

          public SMFParserSequentialType parserCreateSequential​(SMFParserEventsType in_events,
                                                                java.net.URI in_uri,
                                                                java.io.InputStream in_stream)

      Specified by:
        `parserCreateSequential` in interface `SMFParserProviderType`
      Parameters:
        `in_events` - The event receiver
        `in_uri` - The URI referred to by the input stream, for diagnostic messages
        `in_stream` - An input stream
      Returns:
        A new parser for the format
      See Also:
        `SMFFormatDescription.randomAccess()`

    - #### parserCreateRandomAccess

          public SMFParserRandomAccessType parserCreateRandomAccess​(SMFParserEventsType events,
                                                                    java.net.URI uri,
                                                                    java.nio.channels.FileChannel file)
                                                             throws java.lang.UnsupportedOperationException

      Specified by:
        `parserCreateRandomAccess` in interface `SMFParserProviderType`
      Parameters:
        `events` - The event receiver
        `uri` - The URI referred to by the input stream, for diagnostic messages
        `file` - A file channel
      Returns:
        A new parser for the format
      Throws:
        `java.lang.UnsupportedOperationException` - If random-access parsing is not supported
      See Also:
        `SMFFormatDescription.randomAccess()`

    - #### serializerFormat

          public SMFFormatDescription serializerFormat()

      Specified by:
        `serializerFormat` in interface `SMFSerializerProviderType`
      Returns:
        The format that this provider supports

    - #### serializerSupportedVersions

          public java.util.SortedSet<SMFFormatVersion> serializerSupportedVersions()

      Specified by:
        `serializerSupportedVersions` in interface `SMFSerializerProviderType`
      Returns:
        The supported versions of the format

    - #### serializerCreate

          public SMFSerializerType serializerCreate​(SMFFormatVersion version,
                                                    java.net.URI uri,
                                                    java.io.OutputStream stream)
                                             throws java.lang.UnsupportedOperationException

      Specified by:
        `serializerCreate` in interface `SMFSerializerProviderType`
      Parameters:
        `version` - The format version
        `uri` - The URI referred to by the output stream, for diagnostic messages
        `stream` - An output stream
      Returns:
        A new serializer for the format
      Throws:
        `java.lang.UnsupportedOperationException` - If the given version is not supported

    - #### probe

          public SMFPartialLogged<SMFVersionProbed> probe​(java.io.InputStream stream)

      Description copied from interface: `SMFVersionProbeProviderType`
      Attempt to probe the given file stream.
      Specified by:
        `probe` in interface `SMFVersionProbeProviderType`
      Parameters:
        `stream` - The stream
      Returns:
        A probed version or a list of errors