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

public abstract Class BeanDeserializerBase

extends StdDeserializer<Object>
implements Gettable
Class Inheritance
All Implemented Interfaces
tools.jackson.databind.deser.ValueInstantiator.Gettable
Known Direct Subclasses
tools.jackson.databind.deser.bean.BuilderBasedDeserializer, tools.jackson.databind.deser.bean.BeanAsArrayBuilderDeserializer, tools.jackson.databind.deser.bean.BeanAsArrayDeserializer, tools.jackson.databind.deser.bean.BeanDeserializer
Imports
java.lang.reflect.Constructor, .InvocationTargetException, java.util.*, java.util.concurrent.ConcurrentHashMap, com.fasterxml.jackson.annotation.*, tools.jackson.core.*, .JsonParser.NumberType, tools.jackson.databind.*, tools.jackson.databind.cfg.ConfigOverride, tools.jackson.databind.deser.*, tools.jackson.databind.deser.impl.*, tools.jackson.databind.deser.std.StdConvertingDeserializer, .StdDeserializer, tools.jackson.databind.exc.IgnoredPropertyException, tools.jackson.databind.introspect.*, tools.jackson.databind.jsontype.TypeDeserializer, tools.jackson.databind.type.ClassKey, .LogicalType, tools.jackson.databind.util.*

Base class for BeanDeserializer.

Field Summary

Modifier and TypeField and Description
protected SettableAnyProperty
_anySetter

Fallback setter used for handling any properties that are not mapped to regular setters.

protected ValueDeserializer<Object>
_arrayDelegateDeserializer

Deserializer that is used iff array-delegate-based creator is to be used for deserializing from JSON Object.

protected final Map<String, SettableBeanProperty>
_backRefs

We may also have one or more back reference fields (usually zero or one).

protected final BeanPropertyMap
_beanProperties

Mapping of property names to properties, built when all properties to use have been successfully resolved.

protected final JavaType
_beanType

Declared type of the bean this deserializer handles.

protected ValueDeserializer<Object>
_delegateDeserializer

Deserializer that is used iff delegate-based creator is to be used for deserializing from JSON Object.

protected ExternalTypeHandler
_externalTypeIdHandler

Handler that we need if any of properties uses external type id.

protected final Set<String>
_ignorableProps

In addition to properties that are set, we will also keep track of recognized but ignorable properties: these will be skipped without errors or warnings.

protected final boolean
_ignoreAllUnknown

Flag that can be set to ignore and skip unknown properties.

protected final Set<String>
_includableProps

Keep track of the the properties that needs to be specifically included.

protected final ValueInjector[]
_injectables

List of ValueInjectors, if any injectable values are expected by the bean; otherwise null.

protected final boolean
_needViewProcesing

Flag that indicates that some aspect of deserialization depends on active view used (if any)

protected boolean
_nonStandardCreation

Flag that is set to mark cases where deserialization from Object value using otherwise "standard" property binding will need to use non-default creation method: namely, either "full" delegation (array-delegation does not apply), or properties-based Creator method is used.

protected final ObjectIdReader
_objectIdReader

If an Object Id is to be used for value handled by this deserializer, this reader is used for handling.

protected PropertyBasedCreator
_propertyBasedCreator

If the bean needs to be instantiated using constructor or factory method that takes one or more named properties as argument(s), this creator is used for instantiation.

protected final JsonFormat.Shape
_serializationShape

Requested shape from bean class annotations.

protected transient ConcurrentHashMap<ClassKey, ValueDeserializer<Object>>
_subDeserializers

Lazily constructed map used to contain deserializers needed for polymorphic subtypes.

protected UnwrappedPropertyHandler
_unwrappedPropertyHandler

If one of properties has "unwrapped" value, we need separate helper object

protected final ValueInstantiator
_valueInstantiator

Object that handles details of constructing initial bean value (to which bind data to), unless instance is passed (via updateValue())

protected boolean
_vanillaProcessing

Flag that indicates that no "special features" whatsoever are enabled, so the simplest processing is possible.

protected static final PropertyName
Inherited from tools.jackson.databind.deser.std.StdDeserializer:
_valueClass_valueTypeF_MASK_INT_COERCIONS

Constructor Summary

AccessConstructor and Description
protected
BeanDeserializerBase(BeanDeserializerBuilder builder, BeanDescription.Supplier beanDescRef, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, Set<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews)

Constructor used when initially building a deserializer instance, given a BeanDeserializerBuilder that contains configuration.

protected
protected
BeanDeserializerBase(BeanDeserializerBase src, boolean ignoreAllUnknown)

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

Constructor used in cases where unwrapping-with-name-change has been invoked and lookup indices need to be updated.

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

protected

Method Summary

Modifier and TypeMethod and Description
protected Object
_convertObjectId(JsonParser p, DeserializationContext ctxt, Object rawId, ValueDeserializer<Object> idDeser)

Helper method we need to do necessary conversion from whatever native object id type is, into declared type that Jackson internals expect.

protected final ValueDeserializer<Object>
protected final ValueDeserializer<Object>
_delegateDeserializer(JsonParser p)

Alternate to _delegateDeserializer() which will only consider _arrayDelegateDeserializer if given JsonParser points to JsonToken#START_ARRAY token.

protected abstract Object
protected ValueDeserializer<Object>
_findConvertingDeserializer(DeserializationContext ctxt, SettableBeanProperty prop)

Helper method that can be used to see if specified property is annotated to indicate use of a converter for property value (in case of container types, it is container type itself, not key or content type).

private ValueDeserializer<Object>
protected NameTransformer
_findPropertyUnwrapper(DeserializationContext ctxt, SettableBeanProperty prop)

Helper method called to see if given property might be so-called unwrapped property: these require special handling.

protected ValueDeserializer<Object>
_findSubclassDeserializer(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens)

Helper method called to (try to) locate deserializer for given sub-type of type that this deserializer handles.

protected PropertyMetadata
_getSetterInfo(DeserializationContext ctxt, AnnotatedMember accessor, JavaType type)

Method essentially copied from BasicDeserializerFactory, needed to find PropertyMetadata for Delegating Creator, for access to annotation-derived info.

protected BeanDeserializerBase
protected Object
_handleTypedObjectId(JsonParser p, DeserializationContext ctxt, Object pojo, Object rawId)

Off-lined method called to handle "native" Object Id that has been read and known to be associated with given deserialized POJO.

protected void
protected SettableBeanProperty
_resolvedObjectIdProperty(DeserializationContext ctxt, SettableBeanProperty prop)

Method that wraps given property with ObjectIdReferenceProperty in case where object id resolution is required.

protected SettableBeanProperty
_resolveInnerClassValuedProperty(DeserializationContext ctxt, SettableBeanProperty prop)

Helper method that will handle gruesome details of dealing with properties that have non-static inner class as value...

protected SettableBeanProperty
_resolveManagedReferenceProperty(DeserializationContext ctxt, SettableBeanProperty prop)

Helper method called to see if given property is part of 'managed' property pair (managed + back reference), and if so, handle resolution details.

protected SettableBeanProperty
protected abstract BeanDeserializerBase
asArrayDeserializer()

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

public ValueDeserializer<?>
createContextual(DeserializationContext ctxt, BeanProperty property)

Overrides tools.jackson.databind.ValueDeserializer.createContextual.

Although most of post-processing is done in resolve(), we only get access to referring property's annotations here; and this is needed to support per-property ObjectIds.

public Iterator<SettableBeanProperty>
creatorProperties()

Accessor for finding properties that represents values to pass through property-based creator method (constructor or factory method)

public Object
deserializeFromBoolean(JsonParser p, DeserializationContext ctxt)

Method called to deserialize POJO value from a JSON boolean value (true, false)

public Object
deserializeFromDouble(JsonParser p, DeserializationContext ctxt)

Method called to deserialize POJO value from a JSON floating-point number.

public Object
public Object
public abstract Object
deserializeFromObject(JsonParser p, DeserializationContext ctxt)

General version used when handling needs more advanced features.

protected Object
deserializeFromObjectId(JsonParser p, DeserializationContext ctxt)

Method called in cases where it looks like we got an Object Id to parse and use as a reference.

protected Object
public Object
protected Object
deserializeWithObjectId(JsonParser p, DeserializationContext ctxt)

Alternative deserialization method used when we expect to see Object Id; if so, we will need to ensure that the Id is seen before anything else, to ensure that it is available for solving references, even if JSON itself is not ordered that way.

public Object
deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer)

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

Base implementation that does not assume specific type inclusion mechanism.

public SettableBeanProperty
findBackReference(String logicalName)

Overrides tools.jackson.databind.ValueDeserializer.findBackReference.

Method needed by BeanDeserializerFactory to properly link managed- and back-reference pairs.

public SettableBeanProperty
findProperty(PropertyName propertyName)

protected SettableBeanProperty
findProperty(String propertyName)

Accessor for finding the property with given name, if POJO has one.

public SettableBeanProperty
findProperty(int propertyIndex)

Alternate find method that tries to locate a property with given property index.

public AccessPattern
getEmptyAccessPattern()

Overrides tools.jackson.databind.ValueDeserializer.getEmptyAccessPattern.

This method may be called in conjunction with calls to getEmptyValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.

public Object
getEmptyValue(DeserializationContext ctxt)

Overrides tools.jackson.databind.ValueDeserializer.getEmptyValue.

Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings).

public Collection<Object>
getKnownPropertyNames()

Overrides tools.jackson.databind.ValueDeserializer.getKnownPropertyNames.

Method that will either return null to indicate that type being deserializers has no concept of properties; or a collection of identifiers for which toString will give external property name.

public AccessPattern
getNullAccessPattern()

Overrides tools.jackson.databind.ValueDeserializer.getNullAccessPattern.

Implements tools.jackson.databind.deser.NullValueProvider.getNullAccessPattern.

This method may be called in conjunction with calls to getNullValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.

public ObjectIdReader
getObjectIdReader(DeserializationContext ctxt)

Overrides tools.jackson.databind.ValueDeserializer.getObjectIdReader.

Overridden to return true for those instances that are handling value for which Object Identity handling is enabled (either via value type or referring property).

public int
getPropertyCount()

Accessor for checking number of deserialized properties.

public ValueInstantiator
public JavaType
getValueType()

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

Exact structured type this deserializer handles, if known.

public Class<?>
handledType()

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

Method for accessing concrete physical type of values this deserializer produces.

protected void
handleIgnoredProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName)

Method called when an explicitly ignored property (one specified with a name to match, either by property annotation or class annotation) is encountered.

protected Object
handlePolymorphic(JsonParser
(optional) If not null, parser that has more properties to handle (in addition to buffered properties); if null, all properties are passed in buffer
p
,
DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens)

Method called in cases where we may have polymorphic deserialization case: that is, type of Creator-constructed bean is not the type of deserializer itself.

protected Object
handleUnknownProperties(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens)

Method called to handle set of one or more unknown properties, stored in their entirety in given TokenBuffer (as field entries, name and value).

protected void
handleUnknownProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName)

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

Method called when a JSON property is encountered that has not matching setter, any-setter or field, and thus cannot be assigned.

protected void
handleUnknownVanilla(JsonParser p, DeserializationContext ctxt, Object
Either POJO instance (if constructed), or builder (in case of builder-based approach), that has property we haven't been able to handle yet.
beanOrBuilder
,
String propName)

Helper method called for an unknown property, when using "vanilla" processing.

public boolean
hasProperty(String propertyName)

public boolean
protected abstract void
protected void
public boolean
isCachable()

Overrides tools.jackson.databind.ValueDeserializer.isCachable.

Method called to see if deserializer instance is cachable and usable for other properties of same type (type for which instance was created).

public boolean

Returns:

True if this deserializer should match property names without considering casing; false if case has to match exactly.
isCaseInsensitive
()

Accessor for checking whether this deserializer is operating in case-insensitive manner.

public LogicalType
logicalType()

Overrides tools.jackson.databind.ValueDeserializer.logicalType.

Method for accessing logical type of values this deserializer produces.

public Iterator<SettableBeanProperty>
properties()

Accessor for iterating over properties this deserializer uses; with the exception that properties passed via Creator methods (specifically, "property-based constructor") are not included, but can be accessed separate by calling creatorProperties

public void
resolve(DeserializationContext ctxt)

Overrides tools.jackson.databind.ValueDeserializer.resolve.

Method called to finalize setup of this deserializer, after deserializer itself has been registered.

public Boolean
supportsUpdate(DeserializationConfig config)

Overrides tools.jackson.databind.ValueDeserializer.supportsUpdate.

Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not.

private Throwable
public abstract ValueDeserializer<Object>
unwrappingDeserializer(DeserializationContext ctxt, NameTransformer unwrapper)

Overrides 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.

public BeanDeserializerBase
withBeanProperties(BeanPropertyMap props)

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

public abstract BeanDeserializerBase
withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps)

public abstract BeanDeserializerBase
withIgnoreAllUnknown(boolean ignoreUnknown)

public abstract BeanDeserializerBase
public DatabindException
wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt)

Method that will modify caught exception (passed in as argument) as necessary to include reference information, and to ensure it is a subtype of DatabindException, or an unchecked exception.

protected Object
Inherited from tools.jackson.databind.deser.std.StdDeserializer:
_byteOverflow_checkBooleanToStringCoercion_checkCoercionFail_checkDoubleSpecialValue_checkFloatSpecialValue_checkFloatToIntCoercion_checkFloatToStringCoercion_checkFromStringCoercion_checkFromStringCoercion_checkIntToFloatCoercion_checkIntToStringCoercion_checkTextualNull_checkToStringCoercion_coerceBooleanFromInt_coercedTypeDesc_coercedTypeDesc_coerceIntegral_deserializeFromArray_deserializeFromEmptyString_deserializeFromString_deserializeWrappedValue_findCoercionFromBlankString_findCoercionFromEmptyArray_findCoercionFromEmptyString_findNullProvider_hasTextualNull_intOverflow_isBlank_isFalse_isIntNumber_isNaN_isNegInf_isPosInf_isTrue_neitherNull_nonNullNumber_parseBoolean_parseBooleanPrimitive_parseBytePrimitive_parseDate_parseDate_parseDateFromArray_parseDouble_parseDoublePrimitive_parseDoublePrimitive_parseFloatPrimitive_parseFloatPrimitive_parseInteger_parseInteger_parseIntPrimitive_parseIntPrimitive_parseLong_parseLong_parseLongPrimitive_parseLongPrimitive_parseShortPrimitive_parseString_reportFailedNullCoerce_shortOverflow_verifyEndArrayForSingle_verifyNullForPrimitive_verifyNullForPrimitiveCoercion_wrapIOFailurefindContentNullProviderfindContentNullStylefindConvertingContentDeserializerfindDeserializerfindFormatFeaturefindFormatOverridesfindValueNullProvidergetValueTypehandleMissingEndArrayForSinglehandleNestedArrayForSingleisDefaultDeserializerisDefaultKeyDeserializer