public class StringMessageConverter extends AbstractMessageConverter
MessageConverter
that supports MIME type "text/plain" with the
payload converted to and from a String.logger
Constructor and Description |
---|
StringMessageConverter() |
StringMessageConverter(Charset defaultCharset) |
Modifier and Type | Method and Description |
---|---|
Object |
convertFromInternal(Message<?> message,
Class<?> targetClass)
Convert the message payload from serialized form to an Object.
|
Object |
convertToInternal(Object payload,
MessageHeaders headers)
Convert the payload object to serialized form.
|
protected boolean |
supports(Class<?> clazz)
Whether the given class is supported by this converter.
|
canConvertFrom, canConvertTo, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, setContentTypeResolver, setSerializedPayloadClass, supportsMimeType, toMessage
public StringMessageConverter()
public StringMessageConverter(Charset defaultCharset)
protected boolean supports(Class<?> clazz)
AbstractMessageConverter
supports
in class AbstractMessageConverter
clazz
- the class to test for supporttrue
if supported; false
otherwisepublic Object convertFromInternal(Message<?> message, Class<?> targetClass)
AbstractMessageConverter
convertFromInternal
in class AbstractMessageConverter
public Object convertToInternal(Object payload, MessageHeaders headers)
AbstractMessageConverter
convertToInternal
in class AbstractMessageConverter