Interface EncoderRegistry

All Known Implementing Classes:
EncoderRegistryImpl

public interface EncoderRegistry
Manages Transcoder instances.
Since:
9.1
  • Method Details

    • registerTranscoder

      void registerTranscoder(Transcoder transcoder)
      Registers a transcoder in the registry
      Parameters:
      transcoder - the transcoder instance to register
    • getTranscoder

      Transcoder getTranscoder(MediaType type1, MediaType type2)
      Retrieves an instance of Transcoder from the registry.
      Parameters:
      type1 - MediaType supported by the transcoder.
      type2 - MediaType supported by the transcoder.
      Returns:
      An instance of Transcoder capable of doing conversions between the supplied MediaTypes.
    • getTranscoder

      <T extends Transcoder> T getTranscoder(Class<T> clazz)
      Looks up a Transcoder in the registry
      Type Parameters:
      T - the specific transcoder implementation type
      Parameters:
      clazz - the class of the transcoder
      Returns:
      the registered instance of the transcoder
    • isConversionSupported

      boolean isConversionSupported(MediaType from, MediaType to)
      Returns whether conversion between specific MediaTypes is supported
      Parameters:
      from - the source MediaType
      to - the destination MediaType
      Returns:
      true if conversion between the specified types is supported
    • convert

      Object convert(Object o, MediaType from, MediaType to)
      Performs a data conversion.
      Parameters:
      o - object to convert
      from - the object MediaType
      to - the format to convert to
      Returns:
      the object converted.
      Since:
      11.0