Top Description Inners Fields Constructors Methods
tools.jackson.databind.deser.bean

public Class BeanDeserializer

extends BeanDeserializerBase
Class Inheritance
Known Direct Subclasses
tools.jackson.databind.deser.jdk.ThrowableDeserializer
Imports
java.util.*, tools.jackson.core.*, tools.jackson.core.sym.PropertyNameMatcher, tools.jackson.databind.*, tools.jackson.databind.cfg.CoercionAction, tools.jackson.databind.deser.BeanDeserializerBuilder, .ReadableObjectId.Referring, .SettableBeanProperty, .UnresolvedForwardReference, tools.jackson.databind.deser.impl.ExternalTypeHandler, .MethodProperty, .ObjectIdReader, .UnwrappedPropertyHandler, tools.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
protected 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 PropertyNameMatcher
protected SettableBeanProperty[]
Inherited from tools.jackson.databind.deser.bean.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.Supplier beanDescRef, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews)

Constructor used by BeanDeserializerBuilder.

protected
BeanDeserializer(BeanDeserializer 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(BeanDeserializer src, boolean ignoreAllUnknown)

protected
BeanDeserializer(BeanDeserializer src, UnwrappedPropertyHandler unwrapHandler, PropertyBasedCreator propertyBasedCreator, BeanPropertyMap renamedProperties, boolean ignoreAllUnknown)

protected
protected
BeanDeserializer(BeanDeserializer src, Set<String> ignorableProps, Set<String> includableProps)

protected

Method Summary

Modifier and TypeMethod and Description
protected Object
_deserializeFromArray(JsonParser p, DeserializationContext ctxt)

Overrides tools.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 tools.jackson.databind.deser.bean.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 void
protected Object
_handleUnexpectedWithin(JsonParser p, DeserializationContext ctxt, Object bean)

Method called if an unexpected token (other then JsonToken.PROPERTY_NAME) is found after POJO has been instantiated and partially bound.

private final Object
_vanillaDeserialize(JsonParser p, DeserializationContext ctxt)

Streamlined version that is only used when no "special" features are enabled, and when current logical token is JsonToken#START_OBJECT (or equivalent).

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

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

private final Object
protected BeanDeserializerBase
asArrayDeserializer()

Implements abstract tools.jackson.databind.deser.bean.BeanDeserializerBase.asArrayDeserializer.

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

public Object
deserialize(JsonParser p, DeserializationContext ctxt)

Implements abstract tools.jackson.databind.ValueDeserializer.deserialize.

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

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

Overrides tools.jackson.databind.ValueDeserializer.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 tools.jackson.databind.deser.bean.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
protected void
public ValueDeserializer<Object>
unwrappingDeserializer(DeserializationContext ctxt, NameTransformer transformer)

Implements abstract tools.jackson.databind.deser.bean.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.

public BeanDeserializerBase
withBeanProperties(BeanPropertyMap props)

Overrides tools.jackson.databind.deser.bean.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 tools.jackson.databind.deser.bean.BeanDeserializerBase:
_convertObjectId_delegateDeserializer_delegateDeserializer_findConvertingDeserializer_findPropertyUnwrapper_findSubclassDeserializer_getSetterInfo_handleByNameInclusion_handleTypedObjectId_replaceProperty_resolvedObjectIdProperty_resolveInnerClassValuedProperty_resolveManagedReferenceProperty_resolveMergeAndNullSettingscreateContextualcreatorPropertiesdeserializeFromBooleandeserializeFromDoubledeserializeFromEmbeddeddeserializeFromNumberdeserializeFromObjectIddeserializeFromObjectUsingNonDefaultdeserializeFromStringdeserializeWithObjectIddeserializeWithTypefindBackReferencefindPropertyfindPropertyfindPropertygetEmptyAccessPatterngetEmptyValuegetKnownPropertyNamesgetNullAccessPatterngetObjectIdReadergetPropertyCountgetValueInstantiatorgetValueTypehandledTypehandleIgnoredPropertyhandlePolymorphichandleUnknownPropertieshandleUnknownPropertyhandleUnknownVanillahasPropertyhasViewsinjectValuesisCachableisCaseInsensitivelogicalTypepropertiesresolvesupportsUpdatewrapAndThrowwrapInstantiationProblem

Field Detail

_currentlyTransformingback to summary
protected 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)

_propNameMatcherback to summary
protected PropertyNameMatcher _propNameMatcher
_propsByIndexback to summary
protected SettableBeanProperty[] _propsByIndex

Constructor Detail

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

Constructor used by BeanDeserializerBuilder.

BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializer 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(BeanDeserializer src, boolean ignoreAllUnknown)
BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializer src, UnwrappedPropertyHandler unwrapHandler, PropertyBasedCreator propertyBasedCreator, BeanPropertyMap renamedProperties, boolean ignoreAllUnknown)
BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializer src, ObjectIdReader oir)
BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializer src, Set<String> ignorableProps, Set<String> includableProps)
BeanDeserializerback to summary
protected BeanDeserializer(BeanDeserializer src, BeanPropertyMap props)

Method Detail

_deserializeFromArrayback to summary
protected Object _deserializeFromArray(JsonParser p, DeserializationContext ctxt) throws JacksonException

Overrides tools.jackson.databind.deser.std.StdDeserializer._deserializeFromArray.

Doc from tools.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 JacksonException
_deserializeUsingPropertyBasedback to summary
protected Object _deserializeUsingPropertyBased(final JsonParser p, final DeserializationContext ctxt) throws JacksonException

Implements abstract tools.jackson.databind.deser.bean.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 DatabindException
_deserializeWithExternalTypeIdback to summary
protected Object _deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean, ExternalTypeHandler ext) throws JacksonException
_handleNullFromPropsBasedCreatorback to summary
protected void _handleNullFromPropsBasedCreator(JsonParser p, DeserializationContext ctxt, TokenBuffer unknown, List<BeanDeserializer.BeanReferring> referrings)
_handleUnexpectedWithinback to summary
protected Object _handleUnexpectedWithin(JsonParser p, DeserializationContext ctxt, Object bean) throws JacksonException

Method called if an unexpected token (other then JsonToken.PROPERTY_NAME) is found after POJO has been instantiated and partially bound.

Since
3.0
_vanillaDeserializeback to summary
private final Object _vanillaDeserialize(JsonParser p, DeserializationContext ctxt) throws JacksonException

Streamlined version that is only used when no "special" features are enabled, and when current logical token is JsonToken#START_OBJECT (or equivalent).

_vanillaDeserializeback to summary
private final Object _vanillaDeserialize(JsonParser p, DeserializationContext ctxt, JsonToken t) throws JacksonException

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

_vanillaDeserializeWithUnknownback to summary
private final Object _vanillaDeserializeWithUnknown(JsonParser p, DeserializationContext ctxt, Object bean, String propName) throws JacksonException
asArrayDeserializerback to summary
protected BeanDeserializerBase asArrayDeserializer()

Implements abstract tools.jackson.databind.deser.bean.BeanDeserializerBase.asArrayDeserializer.

Doc from tools.jackson.databind.deser.bean.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 JacksonException

Implements abstract tools.jackson.databind.ValueDeserializer.deserialize.

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

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

Overrides tools.jackson.databind.ValueDeserializer.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 JacksonException

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.

deserializeFromObjectback to summary
public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws JacksonException

Implements abstract tools.jackson.databind.deser.bean.BeanDeserializerBase.deserializeFromObject.

General version used when handling needs more advanced features.

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

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 JacksonException
Annotations
@SuppressWarnings:resource
deserializeWithViewback to summary
protected final Object deserializeWithView(JsonParser p, DeserializationContext ctxt, Object bean, Class<?> activeView) throws JacksonException
handleUnresolvedReferenceback to summary
private BeanDeserializer.BeanReferring handleUnresolvedReference(DeserializationContext ctxt, SettableBeanProperty prop, PropertyValueBuffer buffer, UnresolvedForwardReference reference) throws DatabindException
initNameMatcherback to summary
protected void initNameMatcher(DeserializationContext ctxt)

Implements abstract tools.jackson.databind.deser.bean.BeanDeserializerBase.initNameMatcher.

Annotations
@Override
unwrappingDeserializerback to summary
public ValueDeserializer<Object> unwrappingDeserializer(DeserializationContext ctxt, NameTransformer transformer)

Implements abstract tools.jackson.databind.deser.bean.BeanDeserializerBase.unwrappingDeserializer.

Doc from tools.jackson.databind.ValueDeserializer.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
withBeanPropertiesback to summary
public BeanDeserializerBase withBeanProperties(BeanPropertyMap props)

Overrides tools.jackson.databind.deser.bean.BeanDeserializerBase.withBeanProperties.

Doc from tools.jackson.databind.deser.bean.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 tools.jackson.databind.deser.bean.BeanDeserializerBase.withByNameInclusion.

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

Implements abstract tools.jackson.databind.deser.bean.BeanDeserializerBase.withIgnoreAllUnknown.

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

Implements abstract tools.jackson.databind.deser.bean.BeanDeserializerBase.withObjectIdReader.

Annotations
@Override
tools.jackson.databind.deser.bean back to summary

pack-priv Class BeanDeserializer.BeanReferring

extends Referring
Class Inheritance

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 tools.jackson.databind.deser.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(DeserializationContext ctxt, Object id, Object value)

Implements abstract tools.jackson.databind.deser.ReadableObjectId.Referring.handleResolvedForwardReference.

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