java.lang.Object
tools.jackson.databind.deser.DeserializerFactory
tools.jackson.databind.deser.BasicDeserializerFactory
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BeanDeserializerFactory
Abstract factory base class that can provide deserializers for standard
JDK classes, including collection classes and simple heuristics for
"up-casting" common collection interface types
(such as
Collection).
Since all simple deserializers are eagerly instantiated, and there is no additional introspection or customizability of these types, this factory is stateless.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classHelper class to contain default mappings for abstract JDKCollectionandMaptypes. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DeserializerFactoryConfigConfiguration settings for this factory; immutable instance (just like this factory), new version created via copy-constructor (fluent-style)Fields inherited from class tools.jackson.databind.deser.DeserializerFactory
NO_DESERIALIZERS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected ValueInstantiator_constructDefaultValueInstantiator(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) Method that will construct standard defaultValueInstantiatorusing annotations (like @JsonCreator) and visibility rulesprotected ValueDeserializer<?>_findCustomArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) protected ValueDeserializer<Object>_findCustomBeanDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) protected ValueDeserializer<?>_findCustomCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) protected ValueDeserializer<?>_findCustomCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) protected ValueDeserializer<?>_findCustomEnumDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) protected ValueDeserializer<?>_findCustomMapDeserializer(MapType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) protected ValueDeserializer<?>_findCustomMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) protected ValueDeserializer<?>_findCustomReferenceDeserializer(ReferenceType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer contentTypeDeserializer, ValueDeserializer<?> contentDeserializer) protected ValueDeserializer<?>_findCustomTreeNodeDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) protected boolean_hasCreatorAnnotation(MapperConfig<?> config, Annotated ann) protected CollectionType_mapAbstractCollectionType(JavaType type, DeserializationConfig config) protected MapType_mapAbstractMapType(JavaType type, DeserializationConfig config) _valueInstantiatorInstance(DeserializationConfig config, Annotated annotated, Object instDef) protected SettableBeanPropertyconstructCreatorProperty(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, PropertyName name, int index, AnnotatedParameter param, JacksonInject.Value injectable) Method that will construct a property object that represents a logical property passed via Creator (constructor or static factory method)protected EnumResolverconstructEnumNamingStrategyResolver(DeserializationConfig config, AnnotatedClass enumClass) Factory method used to resolve an instance ofCompactStringObjectMapwithEnumNamingStrategyapplied for the target class.protected EnumResolverconstructEnumResolver(DeserializationContext ctxt, Class<?> enumClass, BeanDescription.Supplier beanDescRef) createArrayDeserializer(DeserializationContext ctxt, ArrayType type, BeanDescription.Supplier beanDescRef) Method called to create (or, for completely immutable deserializers, reuse) a deserializer that can convert JSON content into values of specified Java type.createCollectionDeserializer(DeserializationContext ctxt, CollectionType type, BeanDescription.Supplier beanDescRef) createCollectionLikeDeserializer(DeserializationContext ctxt, CollectionLikeType type, BeanDescription.Supplier beanDescRef) createEnumDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Factory method for constructing deserializers ofEnumtypes.createKeyDeserializer(DeserializationContext ctxt, JavaType type) 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(DeserializationContext ctxt, MapType type, BeanDescription.Supplier beanDescRef) createMapLikeDeserializer(DeserializationContext ctxt, MapLikeType type, BeanDescription.Supplier beanDescRef) createReferenceDeserializer(DeserializationContext ctxt, ReferenceType type, BeanDescription.Supplier beanDescRef) createTreeDeserializer(DeserializationConfig config, JavaType nodeType, BeanDescription.Supplier beanDescRef) Method called to create and return a deserializer that can construct JsonNode(s) from JSON content.protected ValueDeserializer<Object>findDefaultDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Helper method called to find one of default deserializers for "well-known" platform types: JDK-provided types, and small number of public Jackson API types.protected ValueDeserializer<Object>Helper method called to check if a class or method has annotation that tells which class to use for deserialization; and if so, to instantiate, that deserializer to use.protected KeyDeserializerHelper method called to check if a class or method has annotation that tells which class to use for deserialization ofMapkeys.protected ValueDeserializer<?>findOptionalStdDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Overridable method called after checking all other types.findValueInstantiator(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) Value instantiator is created both based on creator annotations, and on optional externally provided instantiators (registered through module interface).Method for getting currentDeserializerFactoryConfig.booleanhasExplicitDeserializerFor(DatabindContext ctxt, Class<?> valueType) Method that can be used to check if databind module has deserializer for given (likely JDK) type: explicit meaning that it is not automatically generated for POJO.protected JavaTyperesolveMemberAndTypeAnnotations(DeserializationContext ctxt, AnnotatedMember member, JavaType type) Helper method used to resolve additional type-related annotation information like type overrides, or handler (serializer, deserializer) overrides, so that from declared field, property or constructor parameter type is used as the base and modified based on annotations, if any.final DeserializerFactorywithAdditionalDeserializers(Deserializers additional) Convenience method for creating a new factory instance with additional deserializer provider.final DeserializerFactorywithAdditionalKeyDeserializers(KeyDeserializers additional) Convenience method for creating a new factory instance with additionalKeyDeserializers.protected abstract DeserializerFactorywithConfig(DeserializerFactoryConfig config) final DeserializerFactoryConvenience method for creating a new factory instance with additionalValueDeserializerModifier.final DeserializerFactorywithValueInstantiators(ValueInstantiators instantiators) Convenience method for creating a new factory instance with additionalValueInstantiators.Methods inherited from class tools.jackson.databind.deser.DeserializerFactory
createBeanDeserializer, createBuilderBasedDeserializer
-
Field Details
-
_factoryConfig
Configuration settings for this factory; immutable instance (just like this factory), new version created via copy-constructor (fluent-style)
-
-
Constructor Details
-
BasicDeserializerFactory
-
-
Method Details
-
getFactoryConfig
Method for getting currentDeserializerFactoryConfig.Note that since instances are immutable, you CANNOT change settings by accessing an instance and calling methods: this will simply create new instance of config object.
-
withConfig
-
withAdditionalDeserializers
Convenience method for creating a new factory instance with additional deserializer provider.- Specified by:
withAdditionalDeserializersin classDeserializerFactory
-
withAdditionalKeyDeserializers
Convenience method for creating a new factory instance with additionalKeyDeserializers.- Specified by:
withAdditionalKeyDeserializersin classDeserializerFactory
-
withDeserializerModifier
Convenience method for creating a new factory instance with additionalValueDeserializerModifier.- Specified by:
withDeserializerModifierin classDeserializerFactory
-
withValueInstantiators
Convenience method for creating a new factory instance with additionalValueInstantiators.- Specified by:
withValueInstantiatorsin classDeserializerFactory
-
findValueInstantiator
public ValueInstantiator findValueInstantiator(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) Value instantiator is created both based on creator annotations, and on optional externally provided instantiators (registered through module interface).- Specified by:
findValueInstantiatorin classDeserializerFactory
-
_constructDefaultValueInstantiator
protected ValueInstantiator _constructDefaultValueInstantiator(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) Method that will construct standard defaultValueInstantiatorusing annotations (like @JsonCreator) and visibility rules -
_valueInstantiatorInstance
public ValueInstantiator _valueInstantiatorInstance(DeserializationConfig config, Annotated annotated, Object instDef) -
constructCreatorProperty
protected SettableBeanProperty constructCreatorProperty(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, PropertyName name, int index, AnnotatedParameter param, JacksonInject.Value injectable) Method that will construct a property object that represents a logical property passed via Creator (constructor or static factory method) -
createArrayDeserializer
public ValueDeserializer<?> createArrayDeserializer(DeserializationContext ctxt, ArrayType type, BeanDescription.Supplier beanDescRef) Description copied from class:DeserializerFactoryMethod called to create (or, for completely immutable deserializers, reuse) a deserializer that can convert JSON content into values of specified Java type.- Specified by:
createArrayDeserializerin classDeserializerFactorytype- Type to be deserialized
-
createCollectionDeserializer
public ValueDeserializer<?> createCollectionDeserializer(DeserializationContext ctxt, CollectionType type, BeanDescription.Supplier beanDescRef) - Specified by:
createCollectionDeserializerin classDeserializerFactory
-
_mapAbstractCollectionType
-
createCollectionLikeDeserializer
public ValueDeserializer<?> createCollectionLikeDeserializer(DeserializationContext ctxt, CollectionLikeType type, BeanDescription.Supplier beanDescRef) - Specified by:
createCollectionLikeDeserializerin classDeserializerFactory
-
createMapDeserializer
public ValueDeserializer<?> createMapDeserializer(DeserializationContext ctxt, MapType type, BeanDescription.Supplier beanDescRef) - Specified by:
createMapDeserializerin classDeserializerFactory
-
_mapAbstractMapType
-
createMapLikeDeserializer
public ValueDeserializer<?> createMapLikeDeserializer(DeserializationContext ctxt, MapLikeType type, BeanDescription.Supplier beanDescRef) - Specified by:
createMapLikeDeserializerin classDeserializerFactory
-
createEnumDeserializer
public ValueDeserializer<?> createEnumDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Factory method for constructing deserializers ofEnumtypes.- Specified by:
createEnumDeserializerin classDeserializerFactory
-
createTreeDeserializer
public ValueDeserializer<?> createTreeDeserializer(DeserializationConfig config, JavaType nodeType, BeanDescription.Supplier beanDescRef) Description copied from class:DeserializerFactoryMethod called to create and return a deserializer that can construct JsonNode(s) from JSON content.- Specified by:
createTreeDeserializerin classDeserializerFactory
-
createReferenceDeserializer
public ValueDeserializer<?> createReferenceDeserializer(DeserializationContext ctxt, ReferenceType type, BeanDescription.Supplier beanDescRef) - Specified by:
createReferenceDeserializerin classDeserializerFactory
-
findOptionalStdDeserializer
protected ValueDeserializer<?> findOptionalStdDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Overridable method called after checking all other types. -
createKeyDeserializer
Description copied from class:DeserializerFactoryMethod 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.- Specified by:
createKeyDeserializerin classDeserializerFactory- Returns:
- Key deserializer to use for specified type, if one found; null if not (and default key deserializer should be used)
-
hasExplicitDeserializerFor
Method that can be used to check if databind module has deserializer for given (likely JDK) type: explicit meaning that it is not automatically generated for POJO.This matches
Deserializers.hasDeserializerFor(tools.jackson.databind.DeserializationConfig, java.lang.Class<?>)method.- Specified by:
hasExplicitDeserializerForin classDeserializerFactory- Since:
- 3.0
-
findDefaultDeserializer
public ValueDeserializer<?> findDefaultDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Helper method called to find one of default deserializers for "well-known" platform types: JDK-provided types, and small number of public Jackson API types. -
_findCustomTreeNodeDeserializer
protected ValueDeserializer<?> _findCustomTreeNodeDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) -
_findCustomReferenceDeserializer
protected ValueDeserializer<?> _findCustomReferenceDeserializer(ReferenceType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer contentTypeDeserializer, ValueDeserializer<?> contentDeserializer) -
_findCustomBeanDeserializer
protected ValueDeserializer<Object> _findCustomBeanDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) -
_findCustomArrayDeserializer
protected ValueDeserializer<?> _findCustomArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) -
_findCustomCollectionDeserializer
protected ValueDeserializer<?> _findCustomCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) -
_findCustomCollectionLikeDeserializer
protected ValueDeserializer<?> _findCustomCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) -
_findCustomEnumDeserializer
protected ValueDeserializer<?> _findCustomEnumDeserializer(JavaType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef) -
_findCustomMapDeserializer
protected ValueDeserializer<?> _findCustomMapDeserializer(MapType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) -
_findCustomMapLikeDeserializer
protected ValueDeserializer<?> _findCustomMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription.Supplier beanDescRef, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, ValueDeserializer<?> elementDeserializer) -
findDeserializerFromAnnotation
protected ValueDeserializer<Object> findDeserializerFromAnnotation(DeserializationContext ctxt, Annotated ann) Helper method called to check if a class or method has annotation that tells which class to use for deserialization; and if so, to instantiate, that deserializer to use. Note that deserializer will NOT yet be contextualized so caller needs to take care to call contextualization appropriately. Returns null if no such annotation found. -
findKeyDeserializerFromAnnotation
protected KeyDeserializer findKeyDeserializerFromAnnotation(DeserializationContext ctxt, Annotated ann) Helper method called to check if a class or method has annotation that tells which class to use for deserialization ofMapkeys. Returns null if no such annotation found. -
findContentDeserializerFromAnnotation
protected ValueDeserializer<Object> findContentDeserializerFromAnnotation(DeserializationContext ctxt, Annotated ann) -
resolveMemberAndTypeAnnotations
protected JavaType resolveMemberAndTypeAnnotations(DeserializationContext ctxt, AnnotatedMember member, JavaType type) Helper method used to resolve additional type-related annotation information like type overrides, or handler (serializer, deserializer) overrides, so that from declared field, property or constructor parameter type is used as the base and modified based on annotations, if any. -
constructEnumResolver
protected EnumResolver constructEnumResolver(DeserializationContext ctxt, Class<?> enumClass, BeanDescription.Supplier beanDescRef) -
constructEnumNamingStrategyResolver
protected EnumResolver constructEnumNamingStrategyResolver(DeserializationConfig config, AnnotatedClass enumClass) Factory method used to resolve an instance ofCompactStringObjectMapwithEnumNamingStrategyapplied for the target class. -
_hasCreatorAnnotation
-