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()DefaultTranscoder(GenericJBossMarshaller marshaller, JavaSerializationMarshaller javaMarshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectconvertToOctetStream(java.lang.Object content, MediaType contentType, MediaType destinationType)java.util.Set<MediaType>getSupportedMediaTypes()booleansupportsConversion(MediaType mediaType, MediaType other)java.lang.Objecttranscode(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(GenericJBossMarshaller marshaller, JavaSerializationMarshaller javaMarshaller)
-
DefaultTranscoder
public DefaultTranscoder()
-
-
Method Detail
-
transcode
public java.lang.Object transcode(java.lang.Object content, MediaType contentType, MediaType destinationType)Description copied from interface:TranscoderTranscodes content between two differentMediaType.- Specified by:
transcodein interfaceTranscoder- Parameters:
content- Content to transcode.contentType- TheMediaTypeof the content.destinationType- The targetMediaTypeto 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.IOExceptionjava.lang.InterruptedException
-
getSupportedMediaTypes
public java.util.Set<MediaType> getSupportedMediaTypes()
- Specified by:
getSupportedMediaTypesin interfaceTranscoder- Returns:
- all the
MediaTypehandled by this Transcoder.
-
supportsConversion
public boolean supportsConversion(MediaType mediaType, MediaType other)
- Specified by:
supportsConversionin interfaceTranscoder- Returns:
trueif the transcoder supports the conversion between the suppliedMediaTypes.
-
-