DeserializationContext
to construct actual
JsonDeserializer
instances (which are then cached by
context and/or dedicated cache).
Since there are multiple broad categories of deserializers, there are multiple factory methods:
createArrayDeserializer
)
and the other for other Java containers like java.util.List
s
and java.util.Set
s (createCollectionDeserializer
).
Actually there is also a third method for "Collection-like" types;
things like Scala collections that act like JDK collections but do not
implement same interfaces.
java.util.Map
s
(createMapDeserializer
), and another for POJOs
(createBeanDeserializer
.
As an additional twist there is also a callback for "Map-like" types,
mostly to make it possible to support Scala Maps (which are NOT JDK
Map compatible).
com.fasterxml.jackson.databind.JsonNode
) properties there is
createTreeDeserializer
java.lang.Enum
) there is
createEnumDeserializer
createBeanDeserializer
is used.
Modifier and Type | Field and Description |
---|---|
protected static final Deserializers[] |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public abstract JsonDeserializer | createArrayDeserializer(DeserializationContext ctxt, ArrayType
Type to be deserialized type, BeanDescription beanDesc)Method called to create (or, for completely immutable deserializers, reuse) a deserializer that can convert JSON content into values of specified Java type. |
public abstract JsonDeserializer | createBeanDeserializer(DeserializationContext ctxt, JavaType
Type to be deserialized type, BeanDescription beanDesc)Method called to create (or, for completely immutable deserializers, reuse) a deserializer that can convert JSON content into values of specified Java "bean" (POJO) type. |
public abstract JsonDeserializer | createBuilderBasedDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc, Class<?> builderClass)
Method called to create a deserializer that will use specified Builder class for building value instances. |
public abstract JsonDeserializer | createCollectionDeserializer(DeserializationContext ctxt, CollectionType type, BeanDescription beanDesc)
|
public abstract JsonDeserializer | createCollectionLikeDeserializer(DeserializationContext ctxt, CollectionLikeType type, BeanDescription beanDesc)
|
public abstract JsonDeserializer | |
public abstract KeyDeserializer | Returns: Key deserializer to use for specified type, if one found; null if not (and default key deserializer should be used)Method called to find if factory knows how to create a key deserializer for specified type; currently this means checking if a module has registered possible deserializers. |
public abstract JsonDeserializer | |
public abstract JsonDeserializer | |
public abstract JsonDeserializer | createReferenceDeserializer(DeserializationContext ctxt, ReferenceType type, BeanDescription beanDesc)
|
public abstract JsonDeserializer | createTreeDeserializer(DeserializationConfig config, JavaType type, BeanDescription beanDesc)
Method called to create and return a deserializer that can construct JsonNode(s) from JSON content. |
public abstract TypeDeserializer | Returns: Type deserializer to use for given base type, if one is needed; null if not.Declared base type of the value to deserializer (actual
deserializer type will be this type or its subtype) baseType)Method called to find and create a type information deserializer for given base type, if one is needed. |
public abstract ValueInstantiator | findValueInstantiator(DeserializationContext ctxt, BeanDescription beanDesc)
Method that is to find all creators (constructors, factory methods) for the bean type to deserialize. |
public abstract boolean | hasExplicitDeserializerFor(DeserializationConfig config, Class<?> valueType)
Method that can be used to check if databind module has explicitly declared deserializer for given (likely JDK) type, explicit meaning that there is specific deserializer for given type as opposed to auto-generated "Bean" deserializer. |
public abstract JavaType | mapAbstractType(DeserializationConfig config, JavaType type)
Method that can be called to try to resolve an abstract type (interface, abstract class) into a concrete type, or at least something "more concrete" (abstract class instead of interface). |
public abstract DeserializerFactory | withAbstractTypeResolver(AbstractTypeResolver resolver)
Convenience method for creating a new factory instance with additional
|
public abstract DeserializerFactory | withAdditionalDeserializers(Deserializers additional)
Convenience method for creating a new factory instance with additional deserializer provider. |
public abstract DeserializerFactory | withAdditionalKeyDeserializers(KeyDeserializers additional)
Convenience method for creating a new factory instance with additional
|
public abstract DeserializerFactory | withDeserializerModifier(BeanDeserializerModifier modifier)
Convenience method for creating a new factory instance with additional
|
public abstract DeserializerFactory | withValueInstantiators(ValueInstantiators instantiators)
Convenience method for creating a new factory instance with additional
|
NO_DESERIALIZERS | back to summary |
---|---|
protected static final Deserializers[] NO_DESERIALIZERS |
DeserializerFactory | back to summary |
---|---|
public DeserializerFactory() |
createArrayDeserializer | back to summary |
---|---|
public abstract JsonDeserializer Method called to create (or, for completely immutable deserializers, reuse) a deserializer that can convert JSON content into values of specified Java type.
|
createBeanDeserializer | back to summary |
---|---|
public abstract JsonDeserializer Method called to create (or, for completely immutable deserializers, reuse) a deserializer that can convert JSON content into values of specified Java "bean" (POJO) type. At this point it is known that the type is not otherwise recognized as one of structured types (array, Collection, Map) or a well-known JDK type (enum, primitives/wrappers, String); this method only gets called if other options are exhausted. This also means that this method can be overridden to add support for custom types.
|
createBuilderBasedDeserializer | back to summary |
---|---|
public abstract JsonDeserializer Method called to create a deserializer that will use specified Builder class for building value instances. |
createCollectionDeserializer | back to summary |
---|---|
public abstract JsonDeserializer |
createCollectionLikeDeserializer | back to summary |
---|---|
public abstract JsonDeserializer |
createEnumDeserializer | back to summary |
---|---|
public abstract JsonDeserializer |
createKeyDeserializer | back to summary |
---|---|
public abstract KeyDeserializer createKeyDeserializer(DeserializationContext ctxt, JavaType type) throws JsonMappingException Method called to find if factory knows how to create a key deserializer for specified type; currently this means checking if a module has registered possible deserializers.
|
createMapDeserializer | back to summary |
---|---|
public abstract JsonDeserializer |
createMapLikeDeserializer | back to summary |
---|---|
public abstract JsonDeserializer |
createReferenceDeserializer | back to summary |
---|---|
public abstract JsonDeserializer
|
createTreeDeserializer | back to summary |
---|---|
public abstract JsonDeserializer Method called to create and return a deserializer that can construct JsonNode(s) from JSON content. |
findTypeDeserializer | back to summary |
---|---|
public abstract TypeDeserializer findTypeDeserializer(DeserializationConfig config, JavaType baseType) throws JsonMappingException Method called to find and create a type information deserializer for given base type, if one is needed. If not needed (no polymorphic handling configured for type), should return null. Note that this method is usually only directly called for values of container (Collection, array, Map) types and root values, but not for bean property values.
|
findValueInstantiator | back to summary |
---|---|
public abstract ValueInstantiator findValueInstantiator(DeserializationContext ctxt, BeanDescription beanDesc) throws JsonMappingException Method that is to find all creators (constructors, factory methods) for the bean type to deserialize. |
hasExplicitDeserializerFor | back to summary |
---|---|
public abstract boolean hasExplicitDeserializerFor(DeserializationConfig config, Class<?> valueType) Method that can be used to check if databind module has explicitly declared deserializer
for given (likely JDK) type, explicit meaning that there is specific deserializer for
given type as opposed to auto-generated "Bean" deserializer. Factory itself will check
for known JDK-provided types, but registered Main use for this method is with Safe Default Typing (and generally Safe Polymorphic Deserialization), during which it is good to be able to check that given raw type is explicitly supported and as such "known type" (as opposed to potentially dangerous "gadget type" which could be exploited).
This matches
|
mapAbstractType | back to summary |
---|---|
public abstract JavaType mapAbstractType(DeserializationConfig config, JavaType type) throws JsonMappingException Method that can be called to try to resolve an abstract type (interface, abstract class) into a concrete type, or at least something "more concrete" (abstract class instead of interface). Will either return passed type, or a more specific type. |
withAbstractTypeResolver | back to summary |
---|---|
public abstract DeserializerFactory withAbstractTypeResolver(AbstractTypeResolver resolver) Convenience method for creating a new factory instance with additional
|
withAdditionalDeserializers | back to summary |
---|---|
public abstract DeserializerFactory withAdditionalDeserializers(Deserializers additional) Convenience method for creating a new factory instance with additional deserializer provider. |
withAdditionalKeyDeserializers | back to summary |
---|---|
public abstract DeserializerFactory withAdditionalKeyDeserializers(KeyDeserializers additional) Convenience method for creating a new factory instance with additional
|
withDeserializerModifier | back to summary |
---|---|
public abstract DeserializerFactory withDeserializerModifier(BeanDeserializerModifier modifier) Convenience method for creating a new factory instance with additional
|
withValueInstantiators | back to summary |
---|---|
public abstract DeserializerFactory withValueInstantiators(ValueInstantiators instantiators) Convenience method for creating a new factory instance with additional
|