open class MarshallingMessageConverter : AbstractMessageConverter
Implementation of MessageConverter that can read and write XML using Spring's Marshaller and Unmarshaller abstractions.
This converter requires a Marshaller and Unmarshaller before it can be used. These can be injected by the constructor or bean properties.
Author
Arjen Poutsma
Since
4.2
MarshallingMessageConverter()
Default construct allowing for MarshallingMessageConverter(vararg supportedMimeTypes: MimeType)
Constructor with a given list of MIME types to support. MarshallingMessageConverter(marshaller: Marshaller)
Constructor with Marshaller. If the given Marshaller also implements Unmarshaller, it is also used for unmarshalling. Note that all |
open fun getMarshaller(): Marshaller
Return the configured Marshaller. |
|
open fun getUnmarshaller(): Unmarshaller
Return the configured unmarshaller. |
|
open fun setMarshaller(marshaller: Marshaller): Unit
Set the Marshaller to be used by this message converter. |
|
open fun setUnmarshaller(unmarshaller: Unmarshaller): Unit
Set the Unmarshaller to be used by this message converter. |
fun fromMessage(message: Message<*>, targetClass: Class<*>): Anyfun fromMessage(message: Message<*>, targetClass: Class<*>, conversionHint: Any): Any |
|
open fun getContentTypeResolver(): ContentTypeResolver
Return the configured ContentTypeResolver. |
|
open fun getSerializedPayloadClass(): Class<*>
Return the configured preferred serialization payload class. |
|
open fun getSupportedMimeTypes(): MutableList<MimeType>
Return the supported MIME types. |
|
open fun isStrictContentTypeMatch(): Boolean
Whether content type resolution must produce a value that matches one of the supported MIME types. |
|
open fun setContentTypeResolver(resolver: ContentTypeResolver): Unit
Configure the ContentTypeResolver to use to resolve the content type of an input message. Note that if no resolver is configured, then By default, a |
|
open fun setSerializedPayloadClass(payloadClass: Class<*>): Unit
Configure the preferred serialization class to use (byte[] or String) when converting an Object payload to a Message. The default value is byte[]. |
|
open fun setStrictContentTypeMatch(strictContentTypeMatch: Boolean): Unit
Whether this converter should convert messages for which no content type could be resolved through the configured org.springframework.messaging.converter.ContentTypeResolver. A converter can configured to be strict only when a When this flag is set to |
|
fun toMessage(payload: Any, headers: MessageHeaders): Message<*>fun toMessage(payload: Any, headers: MessageHeaders, conversionHint: Any): Message<*> |