public class GenericMessageConverter
extends java.lang.Object
implements org.springframework.messaging.converter.MessageConverter
Message from serialized form to a typed String and
vice versa.| Constructor and Description |
|---|
GenericMessageConverter() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
fromMessage(org.springframework.messaging.Message<?> message,
java.lang.Class<?> targetClass)
Convert the payload of a
Message from a serialized form to a typed Object of type
stored in message it self. |
org.springframework.messaging.Message<?> |
toMessage(java.lang.Object payload,
org.springframework.messaging.MessageHeaders headers)
Create a
Message whose payload is the result of converting the given payload Object to
serialized form. |
public java.lang.Object fromMessage(org.springframework.messaging.Message<?> message,
java.lang.Class<?> targetClass)
Message from a serialized form to a typed Object of type
stored in message it self.
If the converter cannot perform the conversion it returns null.
fromMessage in interface org.springframework.messaging.converter.MessageConvertermessage - the input messagetargetClass - the target class for the conversionnull if the converter cannot perform the
conversionpublic org.springframework.messaging.Message<?> toMessage(java.lang.Object payload,
org.springframework.messaging.MessageHeaders headers)
Message whose payload is the result of converting the given payload Object to
serialized form. It ignores all headers components.
If the converter cannot perform the conversion, it return null.
toMessage in interface org.springframework.messaging.converter.MessageConverterpayload - the Object to convertheaders - optional headers for the message (may be null)null