Class DefaultTranscoder
- java.lang.Object
-
- org.infinispan.commons.dataconversion.DefaultTranscoder
-
- All Implemented Interfaces:
Transcoder
public final class DefaultTranscoder extends java.lang.Object implements Transcoder
Handle conversions between text/plain, url-encoded, java objects, and octet-stream contents.- Since:
- 9.2
-
-
Constructor Summary
Constructors Constructor Description DefaultTranscoder(Marshaller marshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
convertToOctetStream(java.lang.Object content, MediaType contentType, MediaType destinationType)
java.util.Set<MediaType>
getSupportedMediaTypes()
boolean
supportsConversion(MediaType mediaType, MediaType other)
java.lang.Object
transcode(java.lang.Object content, MediaType contentType, MediaType destinationType)
Transcodes content between two differentMediaType
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.dataconversion.Transcoder
supports
-
-
-
-
Constructor Detail
-
DefaultTranscoder
public DefaultTranscoder(Marshaller marshaller)
-
-
Method Detail
-
transcode
public java.lang.Object transcode(java.lang.Object content, MediaType contentType, MediaType destinationType)
Description copied from interface:Transcoder
Transcodes content between two differentMediaType
.- Specified by:
transcode
in interfaceTranscoder
- Parameters:
content
- Content to transcode.contentType
- TheMediaType
of the content.destinationType
- The targetMediaType
to convert.- Returns:
- the transcoded content.
-
convertToOctetStream
public java.lang.Object convertToOctetStream(java.lang.Object content, MediaType contentType, MediaType destinationType) throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
getSupportedMediaTypes
public java.util.Set<MediaType> getSupportedMediaTypes()
- Specified by:
getSupportedMediaTypes
in interfaceTranscoder
- Returns:
- all the
MediaType
handled by this Transcoder.
-
supportsConversion
public boolean supportsConversion(MediaType mediaType, MediaType other)
- Specified by:
supportsConversion
in interfaceTranscoder
- Returns:
- true if the transcoder supports the conversion between supplied
MediaType
.
-
-