info.bioinfweb.jphyloio.formatinfo

## Interface JPhyloIOFormatInfo

- All Superinterfaces:
    JPhyloIOFormatSpecificObject
  All Known Implementing Classes:
    DefaultFormatInfo

      public interface JPhyloIOFormatInfo
      extends JPhyloIOFormatSpecificObject

  Classes implementing this interface provide information about a phylogenetic file format that is supported by JPhyloIO. and allow to create according file filters and provide information on the content and parameter set of associated implementations of `JPhyloIOEventReader` and `JPhyloIOEventWriter`.
  Since:
    0.0.0
  Author:
    Ben Stöver, Sarah Wiechers

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `JPhyloIOContentExtensionFileFilter` | `createFileFilter(ContentExtensionFileFilter.TestStrategy testStrategy)` Creates a new file filter instance that is associated with the modeled format.
    `java.lang.String` | `getFormatName()` Returns the human readable name of the modeled format.
    `MetadataModeling` | `getMetadataModeling(EventContentType parentContentType, boolean forReading)` Determines which kind of metadata the represented format allows to model nested under the specified data element Readers will not produce metaevents under an unsupported type, while writers will accept but ignore metaevents under this type.
    `java.util.Set<java.lang.String>` | `getSupportedParameters(boolean forReading)` Returns a set of the parameters supported by the associated reader or writer.
    `boolean` | `isElementModeled(EventContentType contentType, boolean forReading)` Determines whether the represented format allows to model the specified data element (content type).

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

      `getFormatID`

- - ### Method Detail

    - #### getFormatName

          java.lang.String getFormatName()

      Returns the human readable name of the modeled format.
      Returns:
        the name of the format

    - #### createFileFilter

          JPhyloIOContentExtensionFileFilter createFileFilter(ContentExtensionFileFilter.TestStrategy testStrategy)

      Creates a new file filter instance that is associated with the modeled format. It will check valid file extensions and possibly the contents of the file, if the extension is not unique.
      Parameters:
        `testStrategy` - the strategy to be used to accept a file or not
      Returns:
        a new file filter instance

    - #### isElementModeled

          boolean isElementModeled(EventContentType contentType,
                                   boolean forReading)

      Determines whether the represented format allows to model the specified data element (content type). Readers will not produce events of an unsupported type, while writers will accept but ignore events of this type.

      Note that the values returned here indicate the capabilities of the provided readers and writers and not the capabilities of the respective format. It may happen that elements of a format are not supported by its reader and writer. In such cases `false` would be returned here for the according content type.

      Note that this method will return `true` for content types that may occur at multiple positions in the event stream (e.g. `EventContentType.LITERAL_META` or `EventContentType.SET_ELEMENT`), if they are supported at least at one position. Use `#isMetadataModeled(EventContentType)` to check at which position metadata elements are supported.

      Parameters:
        `contentType` - the content type to be tested
        `forReading` - Specify `true` here, if support for `contentType` in reading this format or `false` for writing it should be returned.
      Returns:
        `true` if the specified content type is supported, `false` otherwise
      Since:
        0.1.0
      See Also:
        `#isMetadataModeled(EventContentType)`

    - #### getMetadataModeling

          MetadataModeling getMetadataModeling(EventContentType parentContentType,
                                               boolean forReading)

      Determines which kind of metadata the represented format allows to model nested under the specified data element Readers will not produce metaevents under an unsupported type, while writers will accept but ignore metaevents under this type.

      Note that the values returned here indicate the capabilities of the provided readers and writers and not the capabilities of the respective format.

      Parameters:
        `contentType` - the content type of the parent element of possibly supported metadata
        `forReading` - Specify `true` here, if support for metadata nested under `contentType` in reading this format or `false` for writing it should be returned.
      Returns:
        an object describing which metadata is supported, never `null`
      Since:
        0.1.0
      See Also:
        `#isElementModeled(EventContentType)`

    - #### getSupportedParameters

          java.util.Set<java.lang.String> getSupportedParameters(boolean forReading)

      Returns a set of the parameters supported by the associated reader or writer. Parameter names used by readers and writers included in JPhyloIO are defined as string constants in `ReadWriteParameterNames`. Readers and writers from third party developers may introduce additional parameter names defined elsewhere.
      Parameters:
        `forReading` - Specify `true` here, if support for `parameterName` in reading this format or `false` for writing it should be returned.
      Returns:
        an unmodifiable set of supported parameters
      Since:
        0.1.0