Interface MessageConverter
-
- All Known Subinterfaces:
SmartMessageConverter
,StreamMessageConverter
- All Known Implementing Classes:
AbstractJackson2MessageConverter
,AbstractMessageConverter
,AllowedListDeserializingMessageConverter
,ContentTypeDelegatingMessageConverter
,DefaultStreamMessageConverter
,Jackson2JsonMessageConverter
,Jackson2XmlMessageConverter
,MarshallingMessageConverter
,MessagingMessageConverter
,MessagingMessageListenerAdapter.MessagingMessageConverterAdapter
,RemoteInvocationAwareMessageConverterAdapter
,SerializerMessageConverter
,SimpleMessageConverter
public interface MessageConverter
Message converter interface.- Author:
- Mark Fisher, Mark Pollack, Gary Russell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Object
fromMessage(Message message)
Convert from a Message to a Java object.Message
toMessage(Object object, MessageProperties messageProperties)
Convert a Java object to a Message.default Message
toMessage(Object object, MessageProperties messageProperties, Type genericType)
Convert a Java object to a Message.
-
-
-
Method Detail
-
toMessage
Message toMessage(Object object, MessageProperties messageProperties) throws MessageConversionException
Convert a Java object to a Message.- Parameters:
object
- the object to convertmessageProperties
- The message properties.- Returns:
- the Message
- Throws:
MessageConversionException
- in case of conversion failure
-
toMessage
default Message toMessage(Object object, MessageProperties messageProperties, @Nullable Type genericType) throws MessageConversionException
Convert a Java object to a Message. The default implementation callstoMessage(Object, MessageProperties)
.- Parameters:
object
- the object to convertmessageProperties
- The message properties.genericType
- the type to use to populate type headers.- Returns:
- the Message
- Throws:
MessageConversionException
- in case of conversion failure- Since:
- 2.1
-
fromMessage
Object fromMessage(Message message) throws MessageConversionException
Convert from a Message to a Java object.- Parameters:
message
- the message to convert- Returns:
- the converted Java object
- Throws:
MessageConversionException
- in case of conversion failure
-
-