Interface Transcoder

All Known Implementing Classes:
AbstractTranscoder, BinaryTranscoder, DefaultTranscoder, OneToManyTranscoder, TranscoderMarshallerAdapter

public interface Transcoder
Converts content between two or more MediaTypes.

Note: A transcoder must be symmetric: if it can convert from media type X to media type Y, it must also be able to convert from Y to X.

Since:
9.2
  • Method Details

    • transcode

      Object transcode(Object content, MediaType contentType, MediaType destinationType)
      Transcodes content between two different MediaType.
      Parameters:
      content - Content to transcode.
      contentType - The MediaType of the content.
      destinationType - The target MediaType to convert.
      Returns:
      the transcoded content.
    • getSupportedMediaTypes

      Set<MediaType> getSupportedMediaTypes()
      Returns:
      all the MediaType handled by this Transcoder.
    • supportsConversion

      default boolean supportsConversion(MediaType mediaType, MediaType other)
      Returns:
      true if the transcoder supports the conversion between the supplied MediaTypes.
    • supports

      default boolean supports(MediaType mediaType)
      Returns:
      true iff the transcoder supports the conversion to and from the given MediaType.