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

public Class BeanDeserializer

extends BeanDeserializerBase
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer
Imports
java.io.IOException, java.util.*, com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.cfg.CoercionAction, com.fasterxml.jackson.databind.deser.impl.*, .ReadableObjectId.Referring, com.fasterxml.jackson.databind.util.ClassUtil, .IgnorePropertiesUtil, .NameTransformer, .TokenBuffer

Deserializer class that can deserialize instances of arbitrary bean objects, usually from JSON Object structs,

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private transient volatile NameTransformer
_currentlyTransforming

State marker we need in order to avoid infinite recursion for some cases (not very clean, alas, but has to do for now)

protected transient Exception
_nullFromCreator

Lazily constructed exception used as root cause if reporting problem with creator method that returns null (which is not allowed)

private static final long
Inherited from com.fasterxml.jackson.databind.deser.BeanDeserializerBase:
_anySetter_arrayDelegateDeserializer_backRefs_beanProperties_beanType_delegateDeserializer_externalTypeIdHandler_ignorableProps_ignoreAllUnknown_includableProps_injectables_needViewProcesing_nonStandardCreation_objectIdReader_propertyBasedCreator_serializationShape_subDeserializers_unwrappedPropertyHandler_valueInstantiator_vanillaProcessingTEMP_PROPERTY_NAME

Constructor Summary

AccessConstructor and Description
public
BeanDeserializer(BeanDeserializerBuilder builder, BeanDescription beanDesc, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps, boolean ignoreAllUnknown, boolean hasViews)
Deprecated in 2.12, remove from 3.0

Constructor used by BeanDeserializerBuilder.

public
BeanDeserializer(BeanDeserializerBuilder builder, BeanDescription beanDesc, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews)

Constructor used by BeanDeserializerBuilder.

protected
BeanDeserializer(BeanDeserializerBase src)

Copy-constructor that can be used by sub-classes to allow copy-on-write style copying of settings of an existing instance.

protected
BeanDeserializer(BeanDeserializerBase src, boolean ignoreAllUnknown)

protected
public
public
BeanDeserializer(BeanDeserializerBase src, Set<String> ignorableProps)
Deprecated in 2.12, remove from 3.0

public
BeanDeserializer(BeanDeserializerBase src, Set<String> ignorableProps, Set<String> includableProps)

public

Method Summary

Modifier and TypeMethod and Description
protected Exception
_creatorReturnedNullException()

Helper method for getting a lazily construct exception to be reported to DeserializationContext#handleInstantiationProblem(Class, Object, Throwable).

protected Object
_deserializeFromArray(JsonParser p, DeserializationContext ctxt)

Overrides com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromArray.

Helper method that allows easy support for array-related coercion features: checks for either empty array, or single-value array-wrapped value (if coercion enabled by CoercionConfigs (since 2.12), and either reports an exception (if no coercion allowed), or returns appropriate result value using coercion mechanism indicated.

protected final Object
protected Object
_deserializeUsingPropertyBased(final JsonParser p, final DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase._deserializeUsingPropertyBased.

Method called to deserialize bean using "property-based creator": this means that a non-default constructor or factory method is called, and then possibly other setters.

protected final Object
protected Object
protected BeanDeserializerBase
asArrayDeserializer()

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.asArrayDeserializer.

Fluent factory for creating a variant that can handle POJO output as a JSON Array.

public Object
deserialize(JsonParser
Parser used for reading JSON content
p
,
DeserializationContext
Context that can be used to access information about this deserialization activity.
ctxt
)

Implements abstract com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Main deserialization method for bean-based objects (POJOs).

public Object
deserialize(JsonParser p, DeserializationContext ctxt, Object bean)

Overrides com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Secondary deserialization method, called in cases where POJO instance is created as part of deserialization, potentially after collecting some or all of the properties to set.

protected Object
deserializeFromNull(JsonParser p, DeserializationContext ctxt)

Helper method called for rare case of pointing to JsonToken#VALUE_NULL token.

public Object
deserializeFromObject(JsonParser p, DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObject.

General version used when handling needs more advanced features.

protected Object
protected Object
protected Object
protected Object
protected Object
deserializeWithUnwrapped(JsonParser p, DeserializationContext ctxt)

Method called when there are declared "unwrapped" properties which need special handling

protected Object
protected final Object
private BeanDeserializer.BeanReferring
public JsonDeserializer<Object>
unwrappingDeserializer(NameTransformer transformer)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.unwrappingDeserializer.

Method that will return deserializer instance that is able to handle "unwrapped" value instances If no unwrapped instance can be constructed, will simply return this object as-is.

private final Object
vanillaDeserialize(JsonParser p, DeserializationContext ctxt, JsonToken t)

Streamlined version that is only used when no "special" features are enabled.

public BeanDeserializerBase
withBeanProperties(BeanPropertyMap props)

Overrides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withBeanProperties.

Mutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems.

public BeanDeserializer
public BeanDeserializerBase
public BeanDeserializer
Inherited from com.fasterxml.jackson.databind.deser.BeanDeserializerBase:
_convertObjectId_delegateDeserializer_findPropertyUnwrapper_findSubclassDeserializer_handleByNameInclusion_handleTypedObjectId_replaceProperty_resolvedObjectIdProperty_resolveInnerClassValuedProperty_resolveManagedReferenceProperty_resolveMergeAndNullSettingscreateContextualcreatorPropertiesdeserializeFromArraydeserializeFromBooleandeserializeFromDoubledeserializeFromEmbeddeddeserializeFromNumberdeserializeFromObjectIddeserializeFromObjectUsingNonDefaultdeserializeFromStringdeserializeWithObjectIddeserializeWithTypefindBackReferencefindConvertingDeserializerfindPropertyfindPropertyfindPropertygetBeanClassgetEmptyAccessPatterngetEmptyValuegetKnownPropertyNamesgetNullAccessPatterngetObjectIdReadergetPropertyCountgetValueInstantiatorgetValueTypehandledTypehandleIgnoredPropertyhandlePolymorphichandlePolymorphichandleUnknownPropertieshandleUnknownPropertyhandleUnknownVanillahasPropertyhasViewsinjectValuesisCachableisCaseInsensitivelogicalTypepropertiesreplacePropertyresolvesupportsUpdatewithIgnorablePropertieswrapAndThrowwrapInstantiationProblem

Field Detail

_currentlyTransformingback to summary
private transient volatile NameTransformer _currentlyTransforming

State marker we need in order to avoid infinite recursion for some cases (not very clean, alas, but has to do for now)

Since
2.9
_nullFromCreatorback to summary
protected transient Exception _nullFromCreator

Lazily constructed exception used as root cause if reporting problem with creator method that returns null (which is not allowed)

Since
2.8
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.serialVersionUID.

Constructor Detail

BeanDeserializerback to summary
public BeanDeserializer(BeanDeserializerBuilder builder, BeanDescription beanDesc, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps, boolean ignoreAllUnknown, boolean hasViews)

Deprecated

in 2.12, remove from 3.0

Constructor used by BeanDeserializerBuilder.

Annotations
@Deprecated
BeanDeserializerback to summary
public BeanDeserializer(BeanDeserializerBuilder builder, BeanDescription beanDesc, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews)

Constructor used by BeanDeserializerBuilder.

Since
2.12
BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializerBase src)

Copy-constructor that can be used by sub-classes to allow copy-on-write style copying of settings of an existing instance.

BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializerBase src, boolean ignoreAllUnknown)
BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializerBase src, NameTransformer unwrapper)
BeanDeserializerback to summary
public BeanDeserializer(BeanDeserializerBase src, ObjectIdReader oir)
BeanDeserializerback to summary
public BeanDeserializer(BeanDeserializerBase src, Set<String> ignorableProps)

Deprecated

in 2.12, remove from 3.0

Annotations
@Deprecated
BeanDeserializerback to summary
public BeanDeserializer(BeanDeserializerBase src, Set<String> ignorableProps, Set<String> includableProps)
Since
2.12
BeanDeserializerback to summary
public BeanDeserializer(BeanDeserializerBase src, BeanPropertyMap props)

Method Detail

_creatorReturnedNullExceptionback to summary
protected Exception _creatorReturnedNullException()

Helper method for getting a lazily construct exception to be reported to DeserializationContext#handleInstantiationProblem(Class, Object, Throwable).

Since
2.8
_deserializeFromArrayback to summary
protected Object _deserializeFromArray(JsonParser p, DeserializationContext ctxt) throws IOException

Overrides com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromArray.

Doc from com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromArray.

Helper method that allows easy support for array-related coercion features: checks for either empty array, or single-value array-wrapped value (if coercion enabled by CoercionConfigs (since 2.12), and either reports an exception (if no coercion allowed), or returns appropriate result value using coercion mechanism indicated.

This method should NOT be called if Array representation is explicitly supported for type: it should only be called in case it is otherwise unrecognized.

Note

in case of unwrapped single element, will handle actual decoding by calling _deserializeWrappedValue, which by default calls deserialize(JsonParser, DeserializationContext).

Annotations
@Override
_deserializeOtherback to summary
protected final Object _deserializeOther(JsonParser p, DeserializationContext ctxt, JsonToken t) throws IOException
_deserializeUsingPropertyBasedback to summary
protected Object _deserializeUsingPropertyBased(final JsonParser p, final DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase._deserializeUsingPropertyBased.

Method called to deserialize bean using "property-based creator": this means that a non-default constructor or factory method is called, and then possibly other setters. The trick is that values for creator method need to be buffered, first; and due to non-guaranteed ordering possibly some other properties as well.

Annotations
@Override
_deserializeWithErrorWrappingback to summary
protected final Object _deserializeWithErrorWrapping(JsonParser p, DeserializationContext ctxt, SettableBeanProperty prop) throws IOException
_deserializeWithExternalTypeIdback to summary
protected Object _deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean, ExternalTypeHandler ext) throws IOException
asArrayDeserializerback to summary
protected BeanDeserializerBase asArrayDeserializer()

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.asArrayDeserializer.

Doc from com.fasterxml.jackson.databind.deser.BeanDeserializerBase.asArrayDeserializer.

Fluent factory for creating a variant that can handle POJO output as a JSON Array. Implementations may ignore this request if no such input is possible.

Annotations
@Override
deserializeback to summary
public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Main deserialization method for bean-based objects (POJOs).

Parameters
p:JsonParser

Doc from com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Parser used for reading JSON content

ctxt:DeserializationContext

Doc from com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Context that can be used to access information about this deserialization activity.

Returns:Object

Doc from com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Deserialized value

Annotations
@Override
deserializeback to summary
public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean) throws IOException

Overrides com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Secondary deserialization method, called in cases where POJO instance is created as part of deserialization, potentially after collecting some or all of the properties to set.

Annotations
@Override
deserializeFromNullback to summary
protected Object deserializeFromNull(JsonParser p, DeserializationContext ctxt) throws IOException

Helper method called for rare case of pointing to JsonToken#VALUE_NULL token. While this is most often an erroneous condition, there is one specific case with XML handling where polymorphic type with no properties is exposed as such, and should be handled same as empty Object.

Since
2.7
deserializeFromObjectback to summary
public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObject.

General version used when handling needs more advanced features.

Annotations
@Override
deserializeUsingPropertyBasedWithExternalTypeIdback to summary
protected Object deserializeUsingPropertyBasedWithExternalTypeId(JsonParser p, DeserializationContext ctxt) throws IOException
Annotations
@SuppressWarnings:resource
deserializeUsingPropertyBasedWithUnwrappedback to summary
protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p, DeserializationContext ctxt) throws IOException
Annotations
@SuppressWarnings:resource
deserializeWithExternalTypeIdback to summary
protected Object deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt) throws IOException
deserializeWithExternalTypeIdback to summary
protected Object deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean) throws IOException
deserializeWithUnwrappedback to summary
protected Object deserializeWithUnwrapped(JsonParser p, DeserializationContext ctxt) throws IOException

Method called when there are declared "unwrapped" properties which need special handling

Annotations
@SuppressWarnings:resource
deserializeWithUnwrappedback to summary
protected Object deserializeWithUnwrapped(JsonParser p, DeserializationContext ctxt, Object bean) throws IOException
Annotations
@SuppressWarnings:resource
deserializeWithViewback to summary
protected final Object deserializeWithView(JsonParser p, DeserializationContext ctxt, Object bean, Class<?> activeView) throws IOException
handleUnresolvedReferenceback to summary
private BeanDeserializer.BeanReferring handleUnresolvedReference(DeserializationContext ctxt, SettableBeanProperty prop, PropertyValueBuffer buffer, UnresolvedForwardReference reference) throws JsonMappingException
Since
2.8
unwrappingDeserializerback to summary
public JsonDeserializer<Object> unwrappingDeserializer(NameTransformer transformer)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.unwrappingDeserializer.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.unwrappingDeserializer.

Method that will return deserializer instance that is able to handle "unwrapped" value instances If no unwrapped instance can be constructed, will simply return this object as-is.

Default implementation just returns 'this' indicating that no unwrapped variant exists

Annotations
@Override
vanillaDeserializeback to summary
private final Object vanillaDeserialize(JsonParser p, DeserializationContext ctxt, JsonToken t) throws IOException

Streamlined version that is only used when no "special" features are enabled.

withBeanPropertiesback to summary
public BeanDeserializerBase withBeanProperties(BeanPropertyMap props)

Overrides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withBeanProperties.

Doc from com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withBeanProperties.

Mutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems.

Annotations
@Override
withByNameInclusionback to summary
public BeanDeserializer withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withByNameInclusion.

Annotations
@Override
withIgnoreAllUnknownback to summary
public BeanDeserializerBase withIgnoreAllUnknown(boolean ignoreUnknown)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withIgnoreAllUnknown.

Annotations
@Override
withObjectIdReaderback to summary
public BeanDeserializer withObjectIdReader(ObjectIdReader oir)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withObjectIdReader.

Annotations
@Override
com.fasterxml.jackson.databind.deser back to summary

pack-priv Class BeanDeserializer.BeanReferring

extends Referring
Class Inheritance

Since
2.8

Field Summary

Modifier and TypeField and Description
private Object
private final DeserializationContext
private final SettableBeanProperty

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
Inherited from com.fasterxml.jackson.databind.deser.impl.ReadableObjectId.Referring:
getBeanTypegetLocationhasId

Field Detail

_beanback to summary
private Object _bean
_contextback to summary
private final DeserializationContext _context
_propback to summary
private final SettableBeanProperty _prop

Constructor Detail

BeanReferringback to summary
pack-priv BeanReferring(DeserializationContext ctxt, UnresolvedForwardReference ref, JavaType valueType, PropertyValueBuffer buffer, SettableBeanProperty prop)

Method Detail

handleResolvedForwardReferenceback to summary
public void handleResolvedForwardReference(Object id, Object value) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.impl.ReadableObjectId.Referring.handleResolvedForwardReference.

Annotations
@Override
setBeanback to summary
public void setBean(Object bean)