Class DecoderFactory

java.lang.Object
is.galia.codec.DecoderFactory

public final class DecoderFactory extends Object
Used for obtaining Decoder instances.
  • Method Details

    • getAllDecoders

      public static Set<Decoder> getAllDecoders()
      Returns:
      Set of instances of all registered decoders.
    • getAllSupportedFormats

      public static Set<Format> getAllSupportedFormats()
      Returns:
      All formats supported by any Decoder.
    • getPluginDecoders

      public static Set<Decoder> getPluginDecoders()
      Returns:
      Set of instances of all decoders provided by plugins. The instances have not been initialized.
    • newDecoder

      public static Decoder newDecoder(Format format, Arena arena) throws SourceFormatException, DecoderConfigurationException

      Returns a new instance capable of decoding the given format.

      • If a single Decoder implementation exists that supports the format:
        • If there is no configuration preference, or if there is a matching configuration preference, an instance of that that implementation is returned.
        • Otherwise, a DecoderConfigurationException is thrown.
      • If multiple Decoder implementations exist that support the format, the Key.DECODER_FORMATS key in the application configuration is consulted to choose one.
      • If no Decoder implementation exists that supports the format, a SourceFormatException is thrown.
      Parameters:
      format - Format for which to retrieve an instance.
      arena - Will be assigned to the instance before Plugin.initializePlugin() is called.
      Returns:
      Instance capable of decoding the given format.
      Throws:
      SourceFormatException - if the given format is not supported by any decoder.
      DecoderConfigurationException - if the configuration contains an invalid implementation name for the given format.