|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.amqp.support.converter.SerializerMessageConverter
public class SerializerMessageConverter
Implementation of MessageConverter
that can work with Strings or native objects of any kind via the
Serializer
and Deserializer
abstractions in Spring. The toMessage(Object, MessageProperties)
method simply checks the type of the provided instance while the fromMessage(Message)
method relies upon the
content-type
of the provided Message.
Field Summary | |
---|---|
static String |
DEFAULT_CHARSET
|
Constructor Summary | |
---|---|
SerializerMessageConverter()
|
Method Summary | |
---|---|
Object |
fromMessage(Message message)
Converts from a AMQP Message to an Object. |
void |
setDefaultCharset(String defaultCharset)
Specify the default charset to use when converting to or from text-based Message body content. |
void |
setDeserializer(org.springframework.core.serializer.Deserializer<Object> deserializer)
The deserializer to use for converting from message body to Java object. |
void |
setIgnoreContentType(boolean ignoreContentType)
Flag to signal that the content type should be ignored and the deserializer used irrespective if it is a text message. |
void |
setSerializer(org.springframework.core.serializer.Serializer<Object> serializer)
The serializer to use for converting Java objects to message bodies. |
Message |
toMessage(Object object,
MessageProperties messageProperties)
Creates an AMQP Message from the provided Object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CHARSET
Constructor Detail |
---|
public SerializerMessageConverter()
Method Detail |
---|
public void setIgnoreContentType(boolean ignoreContentType)
ignoreContentType
- the flag value to setpublic void setDefaultCharset(String defaultCharset)
public void setSerializer(org.springframework.core.serializer.Serializer<Object> serializer)
serializer
- the serializer to setpublic void setDeserializer(org.springframework.core.serializer.Deserializer<Object> deserializer)
deserializer
- the deserializer to setpublic Object fromMessage(Message message) throws MessageConversionException
fromMessage
in interface MessageConverter
message
- the message to convert
MessageConversionException
- in case of conversion failurepublic Message toMessage(Object object, MessageProperties messageProperties) throws MessageConversionException
toMessage
in interface MessageConverter
object
- the object to convert
MessageConversionException
- in case of conversion failure
|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |