java.lang.Object
tools.jackson.databind.deser.DeserializerFactory
tools.jackson.databind.deser.BasicDeserializerFactory
tools.jackson.databind.deser.BeanDeserializerFactory
- All Implemented Interfaces:
Serializable
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).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.deser.BasicDeserializerFactory
BasicDeserializerFactory.ContainerDefaultMappings -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BeanDeserializerFactoryGlobally shareable thread-safe instance which has no additional custom deserializers registeredFields inherited from class tools.jackson.databind.deser.BasicDeserializerFactory
_factoryConfigFields inherited from class tools.jackson.databind.deser.DeserializerFactory
NO_DESERIALIZERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ValueDeserializer<Object>_findUnsupportedTypeDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) 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).protected void_validateSubType(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) protected voidaddBackReferenceProperties(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, 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 voidaddBeanProps(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder) Method called to figure out settable properties for the bean deserializer to use.protected voidaddInjectables(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder) Method called locate all members used for value injection (if any), constructorValueInjectorinstances, and add them to builder.protected voidaddObjectIdReader(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder) buildBeanDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Method that is to actually build a bean deserializer instance.protected ValueDeserializer<Object>buildBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription.Supplier builderDescRef) Method for constructing a bean deserializer that uses specified intermediate Builder for binding data, and construction of the value instance.buildThrowableDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) protected SettableAnyPropertyconstructAnySetter(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, AnnotatedMember mutator) Method called to construct fallbackSettableAnyPropertyfor handling unknown bean properties, given a method that has been designated as such setter.protected BeanDeserializerBuilderconstructBeanDeserializerBuilder(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) Overridable method that constructs aBeanDeserializerBuilderwhich is used to accumulate information needed to create deserializer instance.protected SettableBeanPropertyconstructSettableProperty(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanPropertyDefinition propDef, JavaType propType0) Method that will construct a regular bean property setter using the given setter method.protected SettableBeanPropertyconstructSetterlessProperty(DeserializationContext ctxt, BeanDescription beanDesc, BeanPropertyDefinition propDef) Method that will construct a regular bean property setter using the given setter method.createBeanDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Method that called to create a new deserializer for types other than Collections, Maps, arrays, referential types or enums, or "well-known" JDK scalar types.createBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription.Supplier valueBeanDescRef, Class<?> builderClass) Method called to create a deserializer that will use specified Builder class for building value instances.protected List<BeanPropertyDefinition>filterBeanProps(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, 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 ValueDeserializer<?>findStdDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Method called byBeanDeserializerFactoryto see if there might be a standard deserializer registered for given type.protected booleanisIgnorableType(DeserializationContext ctxt, 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 booleanisPotentialBeanType(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 JavaTypematerializeAbstractType(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) withConfig(DeserializerFactoryConfig config) Method used by module registration functionality, to construct a new bean deserializer factory with different configuration settings.Methods inherited from class tools.jackson.databind.deser.BasicDeserializerFactory
_constructDefaultValueInstantiator, _findCustomArrayDeserializer, _findCustomBeanDeserializer, _findCustomCollectionDeserializer, _findCustomCollectionLikeDeserializer, _findCustomEnumDeserializer, _findCustomMapDeserializer, _findCustomMapLikeDeserializer, _findCustomReferenceDeserializer, _findCustomTreeNodeDeserializer, _hasCreatorAnnotation, _mapAbstractCollectionType, _mapAbstractMapType, _valueInstantiatorInstance, constructCreatorProperty, constructEnumNamingStrategyResolver, constructEnumResolver, createArrayDeserializer, createCollectionDeserializer, createCollectionLikeDeserializer, createEnumDeserializer, createKeyDeserializer, createMapDeserializer, createMapLikeDeserializer, createReferenceDeserializer, createTreeDeserializer, findContentDeserializerFromAnnotation, findDefaultDeserializer, findDeserializerFromAnnotation, findKeyDeserializerFromAnnotation, findOptionalStdDeserializer, findValueInstantiator, getFactoryConfig, hasExplicitDeserializerFor, resolveMemberAndTypeAnnotations, withAdditionalDeserializers, withAdditionalKeyDeserializers, withDeserializerModifier, withValueInstantiators
-
Field Details
-
instance
Globally shareable thread-safe instance which has no additional custom deserializers registered
-
-
Constructor Details
-
BeanDeserializerFactory
-
-
Method Details
-
withConfig
Method used by module registration functionality, to construct a new bean deserializer factory with different configuration settings.- Specified by:
withConfigin classBasicDeserializerFactory
-
createBeanDeserializer
public ValueDeserializer<Object> createBeanDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Method that called to create a new deserializer for types other than Collections, Maps, arrays, referential types or enums, or "well-known" JDK scalar types.- Specified by:
createBeanDeserializerin classDeserializerFactorytype- Type to be deserialized
-
createBuilderBasedDeserializer
public ValueDeserializer<Object> createBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription.Supplier valueBeanDescRef, Class<?> builderClass) Description copied from class:DeserializerFactoryMethod called to create a deserializer that will use specified Builder class for building value instances.- Specified by:
createBuilderBasedDeserializerin classDeserializerFactory
-
findStdDeserializer
protected ValueDeserializer<?> findStdDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) Method called byBeanDeserializerFactoryto see if there might be a standard deserializer registered for given type. -
_findUnsupportedTypeDeserializer
protected ValueDeserializer<Object> _findUnsupportedTypeDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) 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. -
materializeAbstractType
protected JavaType materializeAbstractType(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) -
buildBeanDeserializer
public ValueDeserializer<Object> buildBeanDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) 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. -
buildBuilderBasedDeserializer
protected ValueDeserializer<Object> buildBuilderBasedDeserializer(DeserializationContext ctxt, JavaType valueType, BeanDescription.Supplier builderDescRef) 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. -
addObjectIdReader
protected void addObjectIdReader(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder) -
buildThrowableDeserializer
public ValueDeserializer<Object> buildThrowableDeserializer(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef) -
constructBeanDeserializerBuilder
protected BeanDeserializerBuilder constructBeanDeserializerBuilder(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) Overridable method that constructs aBeanDeserializerBuilderwhich is used to accumulate information needed to create deserializer instance. -
addBeanProps
protected void addBeanProps(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder) 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.
-
filterBeanProps
protected List<BeanPropertyDefinition> filterBeanProps(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, 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. -
addBackReferenceProperties
protected void addBackReferenceProperties(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, 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. -
addInjectables
protected void addInjectables(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder) Method called locate all members used for value injection (if any), constructorValueInjectorinstances, and add them to builder. -
constructAnySetter
protected SettableAnyProperty constructAnySetter(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, AnnotatedMember mutator) Method called to construct fallbackSettableAnyPropertyfor handling unknown bean properties, given a method that has been designated as such setter.- Parameters:
mutator- 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"
-
constructSettableProperty
protected SettableBeanProperty constructSettableProperty(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef, BeanPropertyDefinition propDef, JavaType propType0) Method that will construct a regular bean property setter using the given setter method.- Returns:
- Property constructed, if any; or null to indicate that there should be no property based on given definitions.
-
constructSetterlessProperty
protected SettableBeanProperty constructSetterlessProperty(DeserializationContext ctxt, BeanDescription beanDesc, BeanPropertyDefinition propDef) Method that will construct a regular bean property setter using the given setter method. -
isPotentialBeanType
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.
-
isIgnorableType
protected boolean isIgnorableType(DeserializationContext ctxt, 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) -
_validateSubType
protected void _validateSubType(DeserializationContext ctxt, JavaType type, BeanDescription.Supplier beanDescRef)
-