public class BeanDeserializerFactory extends BasicDeserializerFactory
Since there is no caching, this factory is stateless and a globally
shared singleton instance (instance
) can be used by
DeserializerProvider
s).
Modifier and Type | Class and Description |
---|---|
static class |
BeanDeserializerFactory.ConfigImpl
Standard configuration settings container class implementation.
|
DeserializerFactory.Config
Modifier and Type | Field and Description |
---|---|
protected DeserializerFactory.Config |
_factoryConfig
Configuration settings for this factory; immutable instance (just like this
factory), new version created via copy-constructor (fluent-style)
|
static BeanDeserializerFactory |
instance
Globally shareable thread-safe instance which has no additional custom deserializers
registered
|
_arrayDeserializers, optionalHandlers
NO_DESERIALIZERS
Constructor and Description |
---|
BeanDeserializerFactory()
Deprecated.
|
BeanDeserializerFactory(DeserializerFactory.Config config) |
Modifier and Type | Method and Description |
---|---|
protected void |
_addDeserializerConstructors(DeserializationConfig config,
BasicBeanDescription beanDesc,
VisibilityChecker<?> vchecker,
AnnotationIntrospector intr,
CreatorCollector creators) |
protected void |
_addDeserializerFactoryMethods(DeserializationConfig config,
BasicBeanDescription beanDesc,
VisibilityChecker<?> vchecker,
AnnotationIntrospector intr,
CreatorCollector creators) |
protected JsonDeserializer<?> |
_findCustomArrayDeserializer(ArrayType type,
DeserializationConfig config,
DeserializerProvider provider,
BeanProperty property,
TypeDeserializer elementTypeDeserializer,
JsonDeserializer<?> elementDeserializer) |
protected JsonDeserializer<Object> |
_findCustomBeanDeserializer(JavaType type,
DeserializationConfig config,
DeserializerProvider provider,
BasicBeanDescription beanDesc,
BeanProperty property) |
protected JsonDeserializer<?> |
_findCustomCollectionDeserializer(CollectionType type,
DeserializationConfig config,
DeserializerProvider provider,
BasicBeanDescription beanDesc,
BeanProperty property,
TypeDeserializer elementTypeDeserializer,
JsonDeserializer<?> elementDeserializer) |
protected JsonDeserializer<?> |
_findCustomCollectionLikeDeserializer(CollectionLikeType type,
DeserializationConfig config,
DeserializerProvider provider,
BasicBeanDescription beanDesc,
BeanProperty property,
TypeDeserializer elementTypeDeserializer,
JsonDeserializer<?> elementDeserializer) |
protected JsonDeserializer<?> |
_findCustomEnumDeserializer(Class<?> type,
DeserializationConfig config,
BasicBeanDescription beanDesc,
BeanProperty property) |
protected JsonDeserializer<?> |
_findCustomMapDeserializer(MapType type,
DeserializationConfig config,
DeserializerProvider provider,
BasicBeanDescription beanDesc,
BeanProperty property,
KeyDeserializer keyDeserializer,
TypeDeserializer elementTypeDeserializer,
JsonDeserializer<?> elementDeserializer) |
protected JsonDeserializer<?> |
_findCustomMapLikeDeserializer(MapLikeType type,
DeserializationConfig config,
DeserializerProvider provider,
BasicBeanDescription beanDesc,
BeanProperty property,
KeyDeserializer keyDeserializer,
TypeDeserializer elementTypeDeserializer,
JsonDeserializer<?> elementDeserializer) |
protected JsonDeserializer<?> |
_findCustomTreeNodeDeserializer(Class<? extends JsonNode> type,
DeserializationConfig config,
BeanProperty property) |
protected boolean |
_handleSingleArgumentConstructor(DeserializationConfig config,
BasicBeanDescription beanDesc,
VisibilityChecker<?> vchecker,
AnnotationIntrospector intr,
CreatorCollector creators,
AnnotatedConstructor ctor,
boolean isCreator,
boolean isVisible) |
protected boolean |
_handleSingleArgumentFactory(DeserializationConfig config,
BasicBeanDescription beanDesc,
VisibilityChecker<?> vchecker,
AnnotationIntrospector intr,
CreatorCollector creators,
AnnotatedMethod factory,
boolean isCreator) |
protected JavaType |
_mapAbstractType2(DeserializationConfig config,
JavaType type)
Method that will find abstract type mapping for specified type, doing a single
lookup through registered abstract type resolvers; will not do recursive lookups.
|
protected void |
addBeanProps(DeserializationConfig config,
BasicBeanDescription beanDesc,
BeanDeserializerBuilder builder)
Method called to figure out settable properties for the
bean deserializer to use.
|
protected void |
addInjectables(DeserializationConfig config,
BasicBeanDescription beanDesc,
BeanDeserializerBuilder builder)
Method called locate all members used for value injection (if any),
constructor
ValueInjector instances, and add them to builder. |
protected void |
addReferenceProperties(DeserializationConfig config,
BasicBeanDescription 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.
|
JsonDeserializer<Object> |
buildBeanDeserializer(DeserializationConfig config,
JavaType type,
BasicBeanDescription beanDesc,
BeanProperty property)
Method that is to actually build a bean deserializer instance.
|
JsonDeserializer<Object> |
buildThrowableDeserializer(DeserializationConfig config,
JavaType type,
BasicBeanDescription beanDesc,
BeanProperty property) |
protected SettableAnyProperty |
constructAnySetter(DeserializationConfig config,
BasicBeanDescription beanDesc,
AnnotatedMethod setter)
Method called to construct fallback
SettableAnyProperty
for handling unknown bean properties, given a method that
has been designated as such setter. |
protected BeanDeserializerBuilder |
constructBeanDeserializerBuilder(BasicBeanDescription beanDesc)
Overridable method that constructs a
BeanDeserializerBuilder
which is used to accumulate information needed to create deserializer
instance. |
protected CreatorProperty |
constructCreatorProperty(DeserializationConfig config,
BasicBeanDescription beanDesc,
String name,
int index,
AnnotatedParameter param,
Object injectableValueId)
Method that will construct a property object that represents
a logical property passed via Creator (constructor or static
factory method)
|
protected ValueInstantiator |
constructDefaultValueInstantiator(DeserializationConfig config,
BasicBeanDescription beanDesc)
Method that will construct standard default
ValueInstantiator
using annotations (like @JsonCreator) and visibility rules |
protected SettableBeanProperty |
constructSettableProperty(DeserializationConfig config,
BasicBeanDescription beanDesc,
String name,
AnnotatedField field) |
protected SettableBeanProperty |
constructSettableProperty(DeserializationConfig config,
BasicBeanDescription beanDesc,
String name,
AnnotatedMethod setter)
Method that will construct a regular bean property setter using
the given setter method.
|
protected SettableBeanProperty |
constructSetterlessProperty(DeserializationConfig config,
BasicBeanDescription beanDesc,
String name,
AnnotatedMethod getter)
Method that will construct a regular bean property setter using
the given setter method.
|
JsonDeserializer<Object> |
createBeanDeserializer(DeserializationConfig config,
DeserializerProvider p,
JavaType type,
BeanProperty property)
Method that
DeserializerProvider s call to create a new
deserializer for types other than Collections, Maps, arrays and
enums. |
KeyDeserializer |
createKeyDeserializer(DeserializationConfig config,
JavaType type,
BeanProperty property)
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.
|
ValueInstantiator |
findValueInstantiator(DeserializationConfig config,
BasicBeanDescription beanDesc)
Value instantiator is created both based on creator annotations,
and on optional externally provided instantiators (registered through
module interface).
|
DeserializerFactory.Config |
getConfig() |
protected boolean |
isIgnorableType(DeserializationConfig config,
BasicBeanDescription beanDesc,
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
can not be (i.e.
|
JavaType |
mapAbstractType(DeserializationConfig config,
JavaType type)
Method that will find complete abstract type mapping for specified type, doing as
many resolution steps as necessary.
|
protected JavaType |
materializeAbstractType(DeserializationConfig config,
BasicBeanDescription beanDesc) |
DeserializerFactory |
withConfig(DeserializerFactory.Config config)
Method used by module registration functionality, to construct a new bean
deserializer factory
with different configuration settings.
|
constructEnumResolver, createArrayDeserializer, createCollectionDeserializer, createCollectionLikeDeserializer, createEnumDeserializer, createMapDeserializer, createMapLikeDeserializer, createTreeDeserializer, findDeserializerFromAnnotation, findPropertyContentTypeDeserializer, findPropertyTypeDeserializer, findStdBeanDeserializer, findTypeDeserializer, modifyTypeByAnnotation, resolveType
withAbstractTypeResolver, withAdditionalDeserializers, withAdditionalKeyDeserializers, withDeserializerModifier, withValueInstantiators
public static final BeanDeserializerFactory instance
protected final DeserializerFactory.Config _factoryConfig
@Deprecated public BeanDeserializerFactory()
public BeanDeserializerFactory(DeserializerFactory.Config config)
public final DeserializerFactory.Config getConfig()
getConfig
in class DeserializerFactory
public DeserializerFactory withConfig(DeserializerFactory.Config config)
withConfig
in class BasicDeserializerFactory
public KeyDeserializer createKeyDeserializer(DeserializationConfig config, JavaType type, BeanProperty property) throws JsonMappingException
DeserializerFactory
createKeyDeserializer
in class DeserializerFactory
JsonMappingException
protected JsonDeserializer<?> _findCustomArrayDeserializer(ArrayType type, DeserializationConfig config, DeserializerProvider provider, BeanProperty property, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException
_findCustomArrayDeserializer
in class BasicDeserializerFactory
JsonMappingException
protected JsonDeserializer<?> _findCustomCollectionDeserializer(CollectionType type, DeserializationConfig config, DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException
_findCustomCollectionDeserializer
in class BasicDeserializerFactory
JsonMappingException
protected JsonDeserializer<?> _findCustomCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException
_findCustomCollectionLikeDeserializer
in class BasicDeserializerFactory
JsonMappingException
protected JsonDeserializer<?> _findCustomEnumDeserializer(Class<?> type, DeserializationConfig config, BasicBeanDescription beanDesc, BeanProperty property) throws JsonMappingException
_findCustomEnumDeserializer
in class BasicDeserializerFactory
JsonMappingException
protected JsonDeserializer<?> _findCustomMapDeserializer(MapType type, DeserializationConfig config, DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException
_findCustomMapDeserializer
in class BasicDeserializerFactory
JsonMappingException
protected JsonDeserializer<?> _findCustomMapLikeDeserializer(MapLikeType type, DeserializationConfig config, DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException
_findCustomMapLikeDeserializer
in class BasicDeserializerFactory
JsonMappingException
protected JsonDeserializer<?> _findCustomTreeNodeDeserializer(Class<? extends JsonNode> type, DeserializationConfig config, BeanProperty property) throws JsonMappingException
_findCustomTreeNodeDeserializer
in class BasicDeserializerFactory
JsonMappingException
protected JsonDeserializer<Object> _findCustomBeanDeserializer(JavaType type, DeserializationConfig config, DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property) throws JsonMappingException
JsonMappingException
public JavaType mapAbstractType(DeserializationConfig config, JavaType type) throws JsonMappingException
mapAbstractType
in class BasicDeserializerFactory
JsonMappingException
public ValueInstantiator findValueInstantiator(DeserializationConfig config, BasicBeanDescription beanDesc) throws JsonMappingException
findValueInstantiator
in class BasicDeserializerFactory
JsonMappingException
public JsonDeserializer<Object> createBeanDeserializer(DeserializationConfig config, DeserializerProvider p, JavaType type, BeanProperty property) throws JsonMappingException
DeserializerProvider
s call to create a new
deserializer for types other than Collections, Maps, arrays and
enums.createBeanDeserializer
in class DeserializerFactory
p
- Provider that can be called to create deserializers for
contained member typestype
- Type to be deserializedJsonMappingException
protected JavaType _mapAbstractType2(DeserializationConfig config, JavaType type) throws JsonMappingException
JsonMappingException
protected JavaType materializeAbstractType(DeserializationConfig config, BasicBeanDescription beanDesc) throws JsonMappingException
JsonMappingException
public JsonDeserializer<Object> buildBeanDeserializer(DeserializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property) throws JsonMappingException
JsonMappingException
public JsonDeserializer<Object> buildThrowableDeserializer(DeserializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property) throws JsonMappingException
JsonMappingException
protected BeanDeserializerBuilder constructBeanDeserializerBuilder(BasicBeanDescription beanDesc)
BeanDeserializerBuilder
which is used to accumulate information needed to create deserializer
instance.protected ValueInstantiator constructDefaultValueInstantiator(DeserializationConfig config, BasicBeanDescription beanDesc) throws JsonMappingException
ValueInstantiator
using annotations (like @JsonCreator) and visibility rulesJsonMappingException
protected void _addDeserializerConstructors(DeserializationConfig config, BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker, AnnotationIntrospector intr, CreatorCollector creators) throws JsonMappingException
JsonMappingException
protected boolean _handleSingleArgumentConstructor(DeserializationConfig config, BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker, AnnotationIntrospector intr, CreatorCollector creators, AnnotatedConstructor ctor, boolean isCreator, boolean isVisible) throws JsonMappingException
JsonMappingException
protected void _addDeserializerFactoryMethods(DeserializationConfig config, BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker, AnnotationIntrospector intr, CreatorCollector creators) throws JsonMappingException
JsonMappingException
protected boolean _handleSingleArgumentFactory(DeserializationConfig config, BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker, AnnotationIntrospector intr, CreatorCollector creators, AnnotatedMethod factory, boolean isCreator) throws JsonMappingException
JsonMappingException
protected CreatorProperty constructCreatorProperty(DeserializationConfig config, BasicBeanDescription beanDesc, String name, int index, AnnotatedParameter param, Object injectableValueId) throws JsonMappingException
JsonMappingException
protected void addBeanProps(DeserializationConfig config, BasicBeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException
Note: designed to be overridable, and effort is made to keep interface similar between versions.
JsonMappingException
protected void addReferenceProperties(DeserializationConfig config, BasicBeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException
JsonMappingException
protected void addInjectables(DeserializationConfig config, BasicBeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException
ValueInjector
instances, and add them to builder.JsonMappingException
protected SettableAnyProperty constructAnySetter(DeserializationConfig config, BasicBeanDescription beanDesc, AnnotatedMethod setter) throws JsonMappingException
SettableAnyProperty
for handling unknown bean properties, given a method that
has been designated as such setter.JsonMappingException
protected SettableBeanProperty constructSettableProperty(DeserializationConfig config, BasicBeanDescription beanDesc, String name, AnnotatedMethod setter) throws JsonMappingException
setter
- Method to use to set property value; or null if none.
Null only for "setterless" propertiesJsonMappingException
protected SettableBeanProperty constructSettableProperty(DeserializationConfig config, BasicBeanDescription beanDesc, String name, AnnotatedField field) throws JsonMappingException
JsonMappingException
protected SettableBeanProperty constructSetterlessProperty(DeserializationConfig config, BasicBeanDescription beanDesc, String name, AnnotatedMethod getter) throws JsonMappingException
getter
- Method to use to get property value to modify, null if
none. Non-null for "setterless" properties.JsonMappingException
protected boolean isPotentialBeanType(Class<?> type)
Note that usually we shouldn't really be getting these sort of types anyway; but better safe than sorry.
protected boolean isIgnorableType(DeserializationConfig config, BasicBeanDescription beanDesc, Class<?> type, Map<Class<?>,Boolean> ignoredTypes)