Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.deser

public Class BeanDeserializerFactory

extends BasicDeserializerFactory
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.*, com.fasterxml.jackson.annotation.*, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder, com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig, com.fasterxml.jackson.databind.deser.impl.*, com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer, com.fasterxml.jackson.databind.exc.InvalidDefinitionException, com.fasterxml.jackson.databind.introspect.*, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.fasterxml.jackson.databind.jsontype.impl.SubTypeValidator, com.fasterxml.jackson.databind.node.ObjectNode, com.fasterxml.jackson.databind.util.BeanUtil, .ClassUtil, .IgnorePropertiesUtil, .SimpleBeanPropertyDefinition

Concrete deserializer factory class that adds full Bean deserializer construction logic using class introspection. Note that factories specifically do not implement any form of caching: aside from configuration they are stateless; caching is implemented by other components.

Instances of this class are fully immutable as all configuration is done by using "fluent factories" (methods that construct new factory instances with different configuration, instead of modifying instance).

Field Summary

Modifier and TypeField and Description
private static final Class<?>[]
INIT_CAUSE_PARAMS

Signature of Throwable.initCause method.

public static final BeanDeserializerFactory
instance

Globally shareable thread-safe instance which has no additional custom deserializers registered

private static final long
Inherited from com.fasterxml.jackson.databind.deser.BasicDeserializerFactory:
_factoryConfigUNWRAPPED_CREATOR_PARAM_NAME

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected JsonDeserializer<Object>
_findUnsupportedTypeDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc)

Helper method called to see if given type, otherwise to be taken as POJO type, is "known but not supported" JDK type, and if so, return alternate handler (deserializer).

private boolean
private SettableAnyProperty
protected void
protected void
addBackReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder)

Method that will find if bean has any managed- or back-reference properties, and if so add them to bean, to be linked during resolution phase.

protected void
addBeanProps(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder)

Method called to figure out settable properties for the bean deserializer to use.

protected void
addInjectables(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder)

Method called locate all members used for value injection (if any), constructor com.fasterxml.jackson.databind.deser.impl.ValueInjector instances, and add them to builder.

protected void
protected void
public JsonDeserializer<Object>
buildBeanDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc)

Method that is to actually build a bean deserializer instance.

protected JsonDeserializer<Object>
buildBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription builderDesc)

Method for constructing a bean deserializer that uses specified intermediate Builder for binding data, and construction of the value instance.

public JsonDeserializer<Object>
protected SettableAnyProperty
constructAnySetter(DeserializationContext ctxt, BeanDescription beanDesc, AnnotatedMember
Either a 2-argument method (setter, with key and value), or a Field or (as of 2.18) Constructor Parameter of type Map or JsonNode/Object; either way accessor used for passing "any values"
mutator
)

Method called to construct fallback SettableAnyProperty for handling unknown bean properties, given a method that has been designated as such setter.

protected BeanDeserializerBuilder
constructBeanDeserializerBuilder(DeserializationContext ctxt, BeanDescription beanDesc)

Overridable method that constructs a BeanDeserializerBuilder which is used to accumulate information needed to create deserializer instance.

protected SettableBeanProperty

Returns:

Property constructed, if any; or null to indicate that there should be no property based on given definitions.
constructSettableProperty
(DeserializationContext ctxt, BeanDescription beanDesc, BeanPropertyDefinition propDef, JavaType propType0)

Method that will construct a regular bean property setter using the given setter method.

protected SettableBeanProperty
constructSetterlessProperty(DeserializationContext ctxt, BeanDescription beanDesc, BeanPropertyDefinition propDef)

Method that will construct a regular bean property setter using the given setter method.

public JsonDeserializer<Object>
createBeanDeserializer(DeserializationContext ctxt, JavaType
Type to be deserialized
type
,
BeanDescription beanDesc)

Implements abstract com.fasterxml.jackson.databind.deser.DeserializerFactory.createBeanDeserializer.

Method that DeserializerCaches call to create a new deserializer for types other than Collections, Maps, arrays and enums.

public JsonDeserializer<Object>
createBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription valueBeanDesc, Class<?> builderClass)

Implements abstract com.fasterxml.jackson.databind.deser.DeserializerFactory.createBuilderBasedDeserializer.

Method called to create a deserializer that will use specified Builder class for building value instances.

protected List<BeanPropertyDefinition>
filterBeanProps(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder, List<BeanPropertyDefinition> propDefsIn, Set<String> ignored)
Deprecated in 2.12, remove from 3.0

Helper method called to filter out explicit ignored properties, as well as properties that have "ignorable types".

protected List<BeanPropertyDefinition>
filterBeanProps(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder, List<BeanPropertyDefinition> propDefsIn, Set<String> ignored, Set<String> included)

Helper method called to filter out explicit ignored properties, as well as properties that have "ignorable types".

protected JsonDeserializer<?>
findStdDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc)

Method called by BeanDeserializerFactory to see if there might be a standard deserializer registered for given type.

protected boolean
isIgnorableType(DeserializationConfig config, BeanPropertyDefinition propDef, Class<?> type, Map<Class<?>, Boolean> ignoredTypes)

Helper method that will check whether given raw type is marked as always ignorable (for purpose of ignoring properties with type)

protected boolean
isPotentialBeanType(Class<?> type)

Helper method used to skip processing for types that we know cannot be (i.e. are never consider to be) beans: things like primitives, Arrays, Enums, and proxy types.

protected JavaType
public DeserializerFactory
withConfig(DeserializerFactoryConfig config)

Implements abstract com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.withConfig.

Method used by module registration functionality, to construct a new bean deserializer factory with different configuration settings.

Inherited from com.fasterxml.jackson.databind.deser.BasicDeserializerFactory:
_addExplicitAnyCreator_addExplicitAnyCreator_addExplicitConstructorCreators_addExplicitDelegatingCreator_addExplicitFactoryCreators_addExplicitPropertyCreator_addImplicitConstructorCreators_addImplicitFactoryCreators_addRecordConstructor_constructDefaultValueInstantiator_findCreatorsFromProperties_findCustomArrayDeserializer_findCustomBeanDeserializer_findCustomCollectionDeserializer_findCustomCollectionLikeDeserializer_findCustomEnumDeserializer_findCustomMapDeserializer_findCustomMapLikeDeserializer_findCustomReferenceDeserializer_findCustomTreeNodeDeserializer_findJsonValueFor_findRemappedType_getSetterInfo_handleSingleArgumentCreator_hasCreatorAnnotation_mapAbstractCollectionType_mapAbstractMapType_reportUnwrappedCreatorProperty_validateNamedPropertyParameter_valueInstantiatorInstanceconstructCreatorPropertyconstructEnumNamingStrategyResolverconstructEnumNamingStrategyResolverconstructEnumResolvercreateArrayDeserializercreateCollectionDeserializercreateCollectionLikeDeserializercreateEnumDeserializercreateKeyDeserializercreateMapDeserializercreateMapLikeDeserializercreateReferenceDeserializercreateTreeDeserializerfindContentDeserializerFromAnnotationfindDefaultDeserializerfindDeserializerFromAnnotationfindKeyDeserializerFromAnnotationfindOptionalStdDeserializerfindPropertyContentTypeDeserializerfindPropertyTypeDeserializerfindTypeDeserializerfindValueInstantiatorgetFactoryConfighasExplicitDeserializerFormapAbstractTypemodifyTypeByAnnotationresolveMemberAndTypeAnnotationsresolveTypewithAbstractTypeResolverwithAdditionalDeserializerswithAdditionalKeyDeserializerswithDeserializerModifierwithValueInstantiators

Field Detail

INIT_CAUSE_PARAMSback to summary
private static final Class<?>[] INIT_CAUSE_PARAMS

Signature of Throwable.initCause method.

instanceback to summary
public static final BeanDeserializerFactory instance

Globally shareable thread-safe instance which has no additional custom deserializers registered

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

BeanDeserializerFactoryback to summary
public BeanDeserializerFactory(DeserializerFactoryConfig config)

Method Detail

_findUnsupportedTypeDeserializerback to summary
protected JsonDeserializer<Object> _findUnsupportedTypeDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) throws JsonMappingException

Helper method called to see if given type, otherwise to be taken as POJO type, is "known but not supported" JDK type, and if so, return alternate handler (deserializer). Initially added to support more meaningful error messages when "Java 8 date/time" support module not registered.

Since
2.12
_isSetterlessTypeback to summary
private boolean _isSetterlessType(Class<?> rawType)
_resolveAnySetterback to summary
private SettableAnyProperty _resolveAnySetter(DeserializationContext ctxt, BeanDescription beanDesc, SettableBeanProperty[] creatorProps) throws JsonMappingException
_validateSubTypeback to summary
protected void _validateSubType(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) throws JsonMappingException
Since
2.8.11
addBackReferencePropertiesback to summary
protected void addBackReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException

Method that will find if bean has any managed- or back-reference properties, and if so add them to bean, to be linked during resolution phase.

Since
2.9
addBeanPropsback to summary
protected void addBeanProps(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException

Method called to figure out settable properties for the bean deserializer to use.

Note

designed to be overridable, and effort is made to keep interface similar between versions.

addInjectablesback to summary
protected void addInjectables(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException

Method called locate all members used for value injection (if any), constructor com.fasterxml.jackson.databind.deser.impl.ValueInjector instances, and add them to builder.

addObjectIdReaderback to summary
protected void addObjectIdReader(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException
addReferencePropertiesback to summary
protected void addReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException

Deprecated

Annotations
@Deprecated
buildBeanDeserializerback to summary
public JsonDeserializer<Object> buildBeanDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) throws JsonMappingException

Method that is to actually build a bean deserializer instance. All basic sanity checks have been done to know that what we have may be a valid bean type, and that there are no default simple deserializers.

Annotations
@SuppressWarnings:unchecked
buildBuilderBasedDeserializerback to summary
protected JsonDeserializer<Object> buildBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription builderDesc) throws JsonMappingException

Method for constructing a bean deserializer that uses specified intermediate Builder for binding data, and construction of the value instance. Note that implementation is mostly copied from the regular BeanDeserializer build method.

Annotations
@SuppressWarnings:unchecked
buildThrowableDeserializerback to summary
public JsonDeserializer<Object> buildThrowableDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) throws JsonMappingException
Annotations
@SuppressWarnings:unchecked
constructAnySetterback to summary
protected SettableAnyProperty constructAnySetter(DeserializationContext ctxt, BeanDescription beanDesc, AnnotatedMember mutator) throws JsonMappingException

Method called to construct fallback SettableAnyProperty for handling unknown bean properties, given a method that has been designated as such setter.

Parameters
mutator:AnnotatedMember

Either a 2-argument method (setter, with key and value), or a Field or (as of 2.18) Constructor Parameter of type Map or JsonNode/Object; either way accessor used for passing "any values"

Annotations
@SuppressWarnings:unchecked
constructBeanDeserializerBuilderback to summary
protected BeanDeserializerBuilder constructBeanDeserializerBuilder(DeserializationContext ctxt, BeanDescription beanDesc)

Overridable method that constructs a BeanDeserializerBuilder which is used to accumulate information needed to create deserializer instance.

constructSettablePropertyback to summary
protected SettableBeanProperty constructSettableProperty(DeserializationContext ctxt, BeanDescription beanDesc, BeanPropertyDefinition propDef, JavaType propType0) throws JsonMappingException

Method that will construct a regular bean property setter using the given setter method.

Returns:SettableBeanProperty

Property constructed, if any; or null to indicate that there should be no property based on given definitions.

constructSetterlessPropertyback to summary
protected SettableBeanProperty constructSetterlessProperty(DeserializationContext ctxt, BeanDescription beanDesc, BeanPropertyDefinition propDef) throws JsonMappingException

Method that will construct a regular bean property setter using the given setter method.

createBeanDeserializerback to summary
public JsonDeserializer<Object> createBeanDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) throws JsonMappingException

Implements abstract com.fasterxml.jackson.databind.deser.DeserializerFactory.createBeanDeserializer.

Method that DeserializerCaches call to create a new deserializer for types other than Collections, Maps, arrays and enums.

Parameters
type:JavaType

Doc from com.fasterxml.jackson.databind.deser.DeserializerFactory.createBeanDeserializer.

Type to be deserialized

Annotations
@SuppressWarnings:unchecked
@Override
createBuilderBasedDeserializerback to summary
public JsonDeserializer<Object> createBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription valueBeanDesc, Class<?> builderClass) throws JsonMappingException

Implements abstract com.fasterxml.jackson.databind.deser.DeserializerFactory.createBuilderBasedDeserializer.

Doc from com.fasterxml.jackson.databind.deser.DeserializerFactory.createBuilderBasedDeserializer.

Method called to create a deserializer that will use specified Builder class for building value instances.

Annotations
@Override
filterBeanPropsback to summary
protected List<BeanPropertyDefinition> filterBeanProps(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder, List<BeanPropertyDefinition> propDefsIn, Set<String> ignored) throws JsonMappingException

Deprecated

in 2.12, remove from 3.0

Helper method called to filter out explicit ignored properties, as well as properties that have "ignorable types". Note that this will not remove properties that have no setters.

Annotations
@Deprecated
filterBeanPropsback to summary
protected List<BeanPropertyDefinition> filterBeanProps(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder, List<BeanPropertyDefinition> propDefsIn, Set<String> ignored, Set<String> included)

Helper method called to filter out explicit ignored properties, as well as properties that have "ignorable types". Note that this will not remove properties that have no setters.

Since
2.12
findStdDeserializerback to summary
protected JsonDeserializer<?> findStdDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) throws JsonMappingException

Method called by BeanDeserializerFactory to see if there might be a standard deserializer registered for given type.

isIgnorableTypeback to summary
protected boolean isIgnorableType(DeserializationConfig config, BeanPropertyDefinition propDef, Class<?> type, Map<Class<?>, Boolean> ignoredTypes)

Helper method that will check whether given raw type is marked as always ignorable (for purpose of ignoring properties with type)

isPotentialBeanTypeback to summary
protected boolean isPotentialBeanType(Class<?> type)

Helper method used to skip processing for types that we know cannot be (i.e. are never consider to be) beans: things like primitives, Arrays, Enums, and proxy types.

Note that usually we shouldn't really be getting these sort of types anyway; but better safe than sorry.

materializeAbstractTypeback to summary
protected JavaType materializeAbstractType(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) throws JsonMappingException
withConfigback to summary
public DeserializerFactory withConfig(DeserializerFactoryConfig config)

Implements abstract com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.withConfig.

Method used by module registration functionality, to construct a new bean deserializer factory with different configuration settings.

Annotations
@Override