- All Known Implementing Classes:
Deserializers.Base,SimpleDeserializers
ValueDeserializer for specified type, or null to indicate that it
does not support handling of the type. In latter case, further calls can be made
for other providers; in former case returned deserializer is used for handling of
instances of specified type.
It is strongly recommended that implementations always extend Deserializers.Base
and NOT just implement Deserializers.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBasicDeserializersimplementation that implements all methods but provides no deserializers. -
Method Summary
Modifier and TypeMethodDescriptiondefault ValueDeserializer<?>findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specified array type.default ValueDeserializer<?>findBeanDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) Method called to locate deserializer for specified value type which does not belong to any other category (not an Enum, Collection, Map, Array, reference value or tree node)default ValueDeserializer<?>findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specifiedCollection(List, Set etc) type.default ValueDeserializer<?>findCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specified "Collection-like" type (one that acts likeCollectionbut does not implement it).default ValueDeserializer<?>findEnumDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) Method called to locate deserializer for specifiedEnumtype.default ValueDeserializer<?>findMapDeserializer(MapType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specifiedMaptype.default ValueDeserializer<?>findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specified "Map-like" type (one that acts likeMapbut does not implement it).default ValueDeserializer<?>findReferenceDeserializer(ReferenceType refType, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer contentTypeDeserializer, ValueDeserializer<?> contentDeserializer) Method called to locate deserializer for value that is of referential type,default ValueDeserializer<?>findTreeNodeDeserializer(JavaType nodeType, DeserializationConfig config, BeanDescription.Supplier beanDescRef) Method called to locate deserializer for specified JSON tree node type.booleanhasDeserializerFor(DeserializationConfig config, Class<?> valueType) Method that may be called to check whether this deserializer provider would provide deserializer for values of given type, without attempting to construct (and possibly fail in some cases) actual deserializer.
-
Method Details
-
findEnumDeserializer
default ValueDeserializer<?> findEnumDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) Method called to locate deserializer for specifiedEnumtype.- Parameters:
type- Type ofEnuminstances to deserializeconfig- Configuration in effectbeanDescRef- Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findTreeNodeDeserializer
default ValueDeserializer<?> findTreeNodeDeserializer(JavaType nodeType, DeserializationConfig config, BeanDescription.Supplier beanDescRef) Method called to locate deserializer for specified JSON tree node type.- Parameters:
nodeType- Specific type of JSON tree nodes to deserialize (subtype ofTreeNode)config- Configuration in effect- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findBeanDeserializer
default ValueDeserializer<?> findBeanDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) Method called to locate deserializer for specified value type which does not belong to any other category (not an Enum, Collection, Map, Array, reference value or tree node)- Parameters:
type- Bean type to deserializeconfig- Configuration in effectbeanDescRef- Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findReferenceDeserializer
default ValueDeserializer<?> findReferenceDeserializer(ReferenceType refType, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer contentTypeDeserializer, ValueDeserializer<?> contentDeserializer) Method called to locate deserializer for value that is of referential type,- Parameters:
refType- Specific referential type to deserializeconfig- Configuration in effectbeanDescRef- Definition of the reference type that contains class annotations and other information typically needed for building deserializerscontentTypeDeserializer- Possible type deserializer for referenced valuecontentDeserializer- Value deserializer to use for referenced value, if indicated by property annotation- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findArrayDeserializer
default ValueDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specified array type.Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).
- Parameters:
type- Type of array instances to deserializeconfig- Configuration in effectbeanDescRef- Definition of the enumeration type that contains class annotations and other information typically needed for building deserializerselementTypeDeserializer- If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.elementDeserializer- Deserializer to use for elements, if explicitly defined (by using annotations, for example). May be null, in which case it will need to be resolved by deserializer at a later point.- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findCollectionDeserializer
default ValueDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specifiedCollection(List, Set etc) type.Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).
- Parameters:
type- Type of collection instances to deserializeconfig- Configuration in effectbeanDescRef- Definition of the enumeration type that contains class annotations and other information typically needed for building deserializerselementTypeDeserializer- If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.elementDeserializer- Deserializer to use for elements, if explicitly defined (by using annotations, for example). May be null, in which case it will need to be resolved by deserializer at a later point.- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findCollectionLikeDeserializer
default ValueDeserializer<?> findCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specified "Collection-like" type (one that acts likeCollectionbut does not implement it).Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).
- Parameters:
type- Type of instances to deserializeconfig- Configuration in effectbeanDescRef- Definition of the enumeration type that contains class annotations and other information typically needed for building deserializerselementTypeDeserializer- If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.elementDeserializer- Deserializer to use for elements, if explicitly defined (by using annotations, for example). May be null, in which case it will need to be resolved by deserializer at a later point.- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findMapDeserializer
default ValueDeserializer<?> findMapDeserializer(MapType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specifiedMaptype.Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).
Similarly, a
KeyDeserializermay be passed, but this is only done if there is a specific configuration override (annotations) to indicate instance to use. Otherwise null is passed, and key deserializer needs to be obtained later during resolution of map serializer constructed here.- Parameters:
type- Type ofMapinstances to deserializeconfig- Configuration in effectbeanDescRef- Definition of the enumeration type that contains class annotations and other information typically needed for building deserializerskeyDeserializer- Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.elementTypeDeserializer- If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.elementDeserializer- Deserializer to use for elements, if explicitly defined (by using annotations, for example). May be null, in which case it will need to be resolved by deserializer at a later point.- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
findMapLikeDeserializer
default ValueDeserializer<?> findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) Method called to locate deserializer for specified "Map-like" type (one that acts likeMapbut does not implement it).Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).
Similarly, a
KeyDeserializermay be passed, but this is only done if there is a specific configuration override (annotations) to indicate instance to use. Otherwise null is passed, and key deserializer needs to be obtained later during resolution, by deserializer constructed here.- Parameters:
type- Type ofMapinstances to deserializeconfig- Configuration in effectbeanDescRef- Definition of the enumeration type that contains class annotations and other information typically needed for building deserializerskeyDeserializer- Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.elementTypeDeserializer- If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.elementDeserializer- Deserializer to use for elements, if explicitly defined (by using annotations, for example). May be null, in which case it will need to be resolved by deserializer at a later point.- Returns:
- Deserializer to use for the type; or null if this provider does not know how to construct it
-
hasDeserializerFor
Method that may be called to check whether this deserializer provider would provide deserializer for values of given type, without attempting to construct (and possibly fail in some cases) actual deserializer. Mostly needed to support validation of polymorphic type ids.Note: implementations should take care NOT to claim supporting types that they do not recognize as this could to incorrect assumption of safe support by caller.
- Since:
- 3.0
-