CompositeMessageConverter

A {@link MessageConverter} that delegates to a list of registered converters to be invoked until one of them returns a non-null result.

<p>As of 4.2.1, this composite converter implements {@link SmartMessageConverter} in order to support the delegation of conversion hints.

@author Rossen Stoyanchev @author Juergen Hoeller @since 4.0

Constructors

this
this(MessageConverter[] converters)

Create an instance with the given converters.

Members

Functions

fromMessage
Object fromMessage(MessageBase message, TypeInfo targetClass)
Undocumented in source. Be warned that the author may not have intended to support it.
fromMessage
Object fromMessage(MessageBase message, TypeInfo targetClass, TypeInfo conversionHint)
Undocumented in source. Be warned that the author may not have intended to support it.
getConverters
MessageConverter[] getConverters()

Return the underlying list of delegate converters.

toMessage
MessageBase toMessage(Object payload, MessageHeaders headers)
Undocumented in source. Be warned that the author may not have intended to support it.
toMessage
MessageBase toMessage(Object payload, MessageHeaders headers, TypeInfo conversionHint)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From SmartMessageConverter

fromMessage
Object fromMessage(MessageBase message, TypeInfo targetClass, TypeInfo conversionHint)

A variant of {@link #fromMessage(Message, Class)} which takes an extra conversion context as an argument, allowing to take e.g. annotations on a payload parameter into account. @param message the input message @param targetClass the target class for the conversion @param conversionHint an extra object passed to the {@link MessageConverter}, e.g. the associated {@code MethodParameter} (may be {@code null}} @return the result of the conversion, or {@code null} if the converter cannot perform the conversion @see #fromMessage(Message, Class)

fromMessage
alias fromMessage = MessageConverter.fromMessage
Undocumented in source.
toMessage
MessageBase toMessage(Object payload, MessageHeaders headers, TypeInfo conversionHint)

A variant of {@link #toMessage(Object, MessageHeaders)} which takes an extra conversion context as an argument, allowing to take e.g. annotations on a return type into account. @param payload the Object to convert @param headers optional headers for the message (may be {@code null}) @param conversionHint an extra object passed to the {@link MessageConverter}, e.g. the associated {@code MethodParameter} (may be {@code null}} @return the new message, or {@code null} if the converter does not support the Object type or the target media type @see #toMessage(Object, MessageHeaders)

toMessage
alias toMessage = MessageConverter.toMessage
Undocumented in source.

Meta