Class DefaultTranscoder
- java.lang.Object
-
- org.infinispan.commons.dataconversion.DefaultTranscoder
-
- All Implemented Interfaces:
Transcoder
public final class DefaultTranscoder extends 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()
DefaultTranscoder(GenericJBossMarshaller marshaller, JavaSerializationMarshaller javaMarshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convertToOctetStream(Object content, MediaType contentType, MediaType destinationType)
Set<MediaType>
getSupportedMediaTypes()
boolean
supportsConversion(MediaType mediaType, MediaType other)
Object
transcode(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(GenericJBossMarshaller marshaller, JavaSerializationMarshaller javaMarshaller)
-
DefaultTranscoder
public DefaultTranscoder()
-
-
Method Detail
-
transcode
public Object transcode(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 Object convertToOctetStream(Object content, MediaType contentType, MediaType destinationType) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
getSupportedMediaTypes
public 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 the suppliedMediaType
s.
-
-