open class MappingJackson2MessageConverter : SmartMessageConverter, BeanClassLoaderAware
Message converter that uses Jackson 2.x to convert messages to and from JSON. Maps an object to a BytesMessage, or to a TextMessage if the targetType is set to MessageType#TEXT. Converts from a TextMessage or BytesMessage to an object.
It customizes Jackson's default properties with the following ones:
MapperFeature#DEFAULT_VIEW_INCLUSION is disabledDeserializationFeature#FAIL_ON_UNKNOWN_PROPERTIES is disabledCompatible with Jackson 2.6 and higher, as of Spring 4.3.
Author
Mark Pollack
Author
Dave Syer
Author
Juergen Hoeller
Author
Stephane Nicoll
Since
3.1.4
MappingJackson2MessageConverter() |
static val DEFAULT_ENCODING: String
The default encoding used for writing to text messages: UTF-8. |
open fun fromMessage(message: Message): Any |
|
open fun setBeanClassLoader(classLoader: ClassLoader): Unit |
|
open fun setEncoding(encoding: String): Unit
Specify the encoding to use when converting to and from text-based message body content. The default encoding will be "UTF-8". When reading from a a text-based message, an encoding may have been suggested through a special JMS property which will then be preferred over the encoding set on this MessageConverter instance. |
|
open fun setEncodingPropertyName(encodingPropertyName: String): Unit
Specify the name of the JMS message property that carries the encoding from bytes to String and back is BytesMessage is used during the conversion process. Default is none. Setting this property is optional; if not set, UTF-8 will be used for decoding any incoming bytes message. |
|
open fun setObjectMapper(objectMapper: ObjectMapper): Unit
Specify the ObjectMapper to use instead of using the default. |
|
open fun setTargetType(targetType: MessageType): Unit
Specify whether The default is |
|
open fun setTypeIdMappings(typeIdMappings: MutableMap<String, Class<*>>): Unit
Specify mappings from type ids to Java classes, if desired. This allows for synthetic ids in the type id message property, instead of transferring Java class names. Default is no custom mappings, i.e. transferring raw Java class names. |
|
open fun setTypeIdPropertyName(typeIdPropertyName: String): Unit
Specify the name of the JMS message property that carries the type id for the contained object: either a mapped id value or a raw Java class name. Default is none. NOTE: This property needs to be set in order to allow for converting from an incoming message to a Java object. |
|
open fun toMessage(object: Any, session: Session): Messageopen fun toMessage(object: Any, session: Session, conversionHint: Any): Messageopen fun toMessage(object: Any, session: Session, jsonView: Class<*>): Message
Convert a Java object to a JMS Message using the specified json view and the supplied session to create the message object. |