public class DefaultJackson2JavaTypeMapper extends AbstractJavaTypeMapper implements Jackson2JavaTypeMapper, ClassMapper
Jackson2JavaTypeMapper.TypePrecedenceDEFAULT_CLASSID_FIELD_NAME, DEFAULT_CONTENT_CLASSID_FIELD_NAME, DEFAULT_KEY_CLASSID_FIELD_NAME| Constructor and Description |
|---|
DefaultJackson2JavaTypeMapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
fromClass(Class<?> clazz,
MessageProperties properties) |
void |
fromJavaType(com.fasterxml.jackson.databind.JavaType javaType,
MessageProperties properties) |
Jackson2JavaTypeMapper.TypePrecedence |
getTypePrecedence()
Return the precedence.
|
void |
setTrustedPackages(String... trustedPackages)
Specify a set of packages to trust during deserialization.
|
void |
setTypePrecedence(Jackson2JavaTypeMapper.TypePrecedence typePrecedence)
Set the precedence for evaluating type information in message properties.
|
Class<?> |
toClass(MessageProperties properties) |
com.fasterxml.jackson.databind.JavaType |
toJavaType(MessageProperties properties) |
addHeader, fromInferredTypeHeader, getClassIdFieldName, getClassLoader, getContentClassIdFieldName, getIdClassMapping, getKeyClassIdFieldName, hasInferredTypeHeader, retrieveHeader, retrieveHeaderAsString, setBeanClassLoader, setIdClassMappingpublic Jackson2JavaTypeMapper.TypePrecedence getTypePrecedence()
getTypePrecedence in interface Jackson2JavaTypeMappersetTypePrecedence(Jackson2JavaTypeMapper.TypePrecedence)public void setTypePrecedence(Jackson2JavaTypeMapper.TypePrecedence typePrecedence)
@RabbitListener at the method level, the framework attempts
to determine the target type for payload conversion from the method signature.
If so, this type is provided in the
inferredArgumentType
message property.
By default, if the type is concrete (not abstract, not an interface), this will
be used ahead of type information provided in the __TypeId__ and
associated headers provided by the sender.
If you wish to force the use of the __TypeId__ and associated headers
(such as when the actual type is a subclass of the method argument type),
set the precedence to Jackson2JavaTypeMapper.TypePrecedence.TYPE_ID.
typePrecedence - the precedence.public void setTrustedPackages(String... trustedPackages)
*) means trust all.trustedPackages - the trusted Java packages for deserializationpublic com.fasterxml.jackson.databind.JavaType toJavaType(MessageProperties properties)
toJavaType in interface Jackson2JavaTypeMapperpublic void fromJavaType(com.fasterxml.jackson.databind.JavaType javaType,
MessageProperties properties)
fromJavaType in interface Jackson2JavaTypeMapperpublic void fromClass(Class<?> clazz, MessageProperties properties)
fromClass in interface ClassMapperpublic Class<?> toClass(MessageProperties properties)
toClass in interface ClassMapper