MessageConverter that delegates to a list of registered converters
to be invoked until one of them returns a non-null result.
As of 4.2.1, this composite converter implements SmartMessageConverter
in order to support the delegation of conversion hints.
| Modifier and Type | Field and Description |
|---|---|
| private final List |
| Access | Constructor and Description |
|---|---|
| public | CompositeMessageConverter(Collection<MessageConverter> converters)
Create an instance with the given converters. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | fromMessage(Message<?>
the input message message, Class<?> the target class for the conversion targetClass)Implements org. Message from a serialized form to a typed Object
of the specified target class.
|
| public Object | fromMessage(Message<?>
the input message message, Class<?> the target class for the conversion targetClass, Object conversionHint)Implements org. fromMessage(Message, Class) which takes an extra
conversion context as an argument, allowing to take e.g. annotations
on a payload parameter into account.
|
| public List | |
| public Message | toMessage(Object
the Object to convert payload, MessageHeaders optional headers for the message (may be headers)null)Implements org. Message whose payload is the result of converting the given
payload Object to serialized form.
|
| public Message | toMessage(Object
the Object to convert payload, MessageHeaders optional headers for the message (may be headers, Object conversionHint)null)Implements org. toMessage(Object, MessageHeaders) which takes an extra
conversion context as an argument, allowing to take e.g. annotations
on a return type into account.
|
| public String |
| converters | back to summary |
|---|---|
| private final List<MessageConverter> converters | |
| CompositeMessageConverter | back to summary |
|---|---|
| public CompositeMessageConverter(Collection<MessageConverter> converters) Create an instance with the given converters. | |
| fromMessage | back to summary |
|---|---|
| public Object fromMessage(Message<?> message, Class<?> targetClass) Implements org. Doc from org. Convert the payload of a If the converter does not support the specified media type or cannot perform
the conversion, it should return | |
| fromMessage | back to summary |
|---|---|
| public Object fromMessage(Message<?> message, Class<?> targetClass, Object conversionHint) Implements org. Doc from org. A variant of
| |
| getConverters | back to summary |
|---|---|
| public List Return the underlying list of delegate converters. | |
| toMessage | back to summary |
|---|---|
| public Message Implements org. Doc from org. Create a If the converter does not support the specified media type or cannot perform
the conversion, it should return
| |
| toMessage | back to summary |
|---|---|
| public Message Implements org. Doc from org. A variant of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |