Class StringConverter
- java.lang.Object
-
- com.contentgrid.opa.client.rest.client.jdk.converter.StringConverter
-
- All Implemented Interfaces:
HttpBodyConverter
public class StringConverter extends java.lang.Object implements HttpBodyConverter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.contentgrid.opa.client.rest.client.jdk.converter.HttpBodyConverter
HttpBodyConverter.DeserializationContext, HttpBodyConverter.SerializationContext
-
-
Constructor Summary
Constructors Constructor Description StringConverter()Default constructor that uses"ISO-8859-1"as default character set.StringConverter(java.nio.charset.Charset defaultCharset)A constructor accepting a default charset to use if the requested content type does not specify one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> booleancanRead(HttpBodyConverter.DeserializationContext context, java.lang.Class<T> type)booleancanWrite(HttpBodyConverter.SerializationContext context)java.util.Collection<MediaType>getSupportedMediaTypes()<T> Tread(HttpBodyConverter.DeserializationContext context, java.lang.Class<T> type)byte[]write(HttpBodyConverter.SerializationContext context)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.contentgrid.opa.client.rest.client.jdk.converter.HttpBodyConverter
supportsMediaType
-
-
-
-
Constructor Detail
-
StringConverter
public StringConverter()
Default constructor that uses"ISO-8859-1"as default character set. This is specified as the default for text/* by RFC2616- See Also:
- Section 3.7.1 of [RFC2616]
-
StringConverter
public StringConverter(java.nio.charset.Charset defaultCharset)
A constructor accepting a default charset to use if the requested content type does not specify one.
-
-
Method Detail
-
canRead
public <T> boolean canRead(HttpBodyConverter.DeserializationContext context, java.lang.Class<T> type)
- Specified by:
canReadin interfaceHttpBodyConverter
-
read
public <T> T read(HttpBodyConverter.DeserializationContext context, java.lang.Class<T> type)
- Specified by:
readin interfaceHttpBodyConverter
-
canWrite
public boolean canWrite(HttpBodyConverter.SerializationContext context)
- Specified by:
canWritein interfaceHttpBodyConverter
-
write
public byte[] write(HttpBodyConverter.SerializationContext context)
- Specified by:
writein interfaceHttpBodyConverter
-
getSupportedMediaTypes
public java.util.Collection<MediaType> getSupportedMediaTypes()
- Specified by:
getSupportedMediaTypesin interfaceHttpBodyConverter
-
-