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

public abstract Class BeanDeserializerBase

extends StdDeserializer<Object>
implements ContextualDeserializer, ResolvableDeserializer, Gettable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, com.fasterxml.jackson.databind.deser.ValueInstantiator.Gettable, com.fasterxml.jackson.databind.deser.ResolvableDeserializer, com.fasterxml.jackson.databind.deser.ContextualDeserializer
Known Direct Subclasses
com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer, com.fasterxml.jackson.databind.deser.impl.BeanAsArrayBuilderDeserializer, com.fasterxml.jackson.databind.deser.impl.BeanAsArrayDeserializer, com.fasterxml.jackson.databind.deser.BeanDeserializer
Imports
java.io.IOException, java.lang.reflect.Constructor, .InvocationTargetException, java.util.*, java.util.concurrent.ConcurrentHashMap, com.fasterxml.jackson.annotation.*, com.fasterxml.jackson.core.*, .JsonParser.NumberType, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.cfg.ConfigOverride, com.fasterxml.jackson.databind.deser.impl.*, com.fasterxml.jackson.databind.deser.std.StdDelegatingDeserializer, .StdDeserializer, com.fasterxml.jackson.databind.exc.IgnoredPropertyException, com.fasterxml.jackson.databind.introspect.*, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.fasterxml.jackson.databind.type.ClassKey, .LogicalType, com.fasterxml.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 JsonDeserializer<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 JsonDeserializer<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, JsonDeserializer<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.

private static final long
protected static final PropertyName
Inherited from com.fasterxml.jackson.databind.deser.std.StdDeserializer:
_valueClass_valueTypeF_MASK_ACCEPT_ARRAYSF_MASK_INT_COERCIONS

Constructor Summary

AccessConstructor and Description
protected
BeanDeserializerBase(BeanDeserializerBuilder builder, BeanDescription beanDesc, 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
public
public
BeanDeserializerBase(BeanDeserializerBase src, Set<String> ignorableProps, Set<String> includableProps)

protected
protected
BeanDeserializerBase(BeanDeserializerBase src, Set<String> ignorableProps)
Deprecated

Method Summary

Modifier and TypeMethod and Description
protected Object
_convertObjectId(JsonParser p, DeserializationContext ctxt, Object rawId, JsonDeserializer<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 JsonDeserializer<Object>
protected final JsonDeserializer<Object>
_delegateDeserializer(JsonParser p)

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

protected abstract Object
private JsonDeserializer<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 JsonDeserializer<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)

Offlined 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 JsonDeserializer<?>
createContextual(DeserializationContext
Deserialization context to access configuration, additional deserializers that may be needed by this deserializer
ctxt
,
BeanProperty
Method, field or constructor parameter that represents the property (and is used to assign deserialized value). Should be available; but there may be cases where caller cannot provide it and null is passed instead (in which case impls usually pass 'this' deserializer as is)
property
)

Implements com.fasterxml.jackson.databind.deser.ContextualDeserializer.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
deserializeFromArray(JsonParser p, DeserializationContext ctxt)
Deprecated Since 2.11 Should not be used: was never meant to be called by code other than sub-classes (implementations), and implementations details differ

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
Deserializer to use for handling type information
typeDeserializer
)

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

Base implementation that does not assume specific type inclusion mechanism.

public SettableBeanProperty
findBackReference(String logicalName)

Overrides com.fasterxml.jackson.databind.JsonDeserializer.findBackReference.

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

protected JsonDeserializer<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).

public SettableBeanProperty
findProperty(PropertyName propertyName)

public 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 final Class<?>
getBeanClass()
Deprecated Since 2.3, use handledType() instead

public AccessPattern
getEmptyAccessPattern()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.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 com.fasterxml.jackson.databind.JsonDeserializer.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 com.fasterxml.jackson.databind.JsonDeserializer.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 com.fasterxml.jackson.databind.JsonDeserializer.getNullAccessPattern.

Implements com.fasterxml.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()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.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 com.fasterxml.jackson.databind.deser.std.StdDeserializer.getValueType.

Exact structured type this deserializer handles, if known.

public Class<?>
handledType()

Overrides com.fasterxml.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
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, StreamReadConstraints streamReadConstraints, 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
Parser that points to value of the unknown property
p
,
DeserializationContext
Context for deserialization; allows access to the parser, error reporting functionality
ctxt
,
Object
Instance that is being populated by this deserializer, or if not known, Class that would be instantiated. If null, will assume type is what getValueClass returns.
beanOrClass
,
String
Name of the property that cannot be mapped
propName
)

Overrides com.fasterxml.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 void
public boolean
isCachable()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.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 com.fasterxml.jackson.databind.JsonDeserializer.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
replaceProperty(SettableBeanProperty
Property to replace
original
,
SettableBeanProperty
Property to replace it with
replacement
)

Method that can be used to replace an existing property with a modified one.

public void
resolve(DeserializationContext
Context to use for accessing configuration, resolving secondary deserializers
ctxt
)

Implements com.fasterxml.jackson.databind.deser.ResolvableDeserializer.resolve.

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

public Boolean
supportsUpdate(DeserializationConfig config)

Overrides com.fasterxml.jackson.databind.JsonDeserializer.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 JsonDeserializer<Object>
unwrappingDeserializer(NameTransformer unwrapper)

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

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 BeanDeserializerBase
withIgnorableProperties(Set<String> ignorableProps)
Deprecated Since 2.12 use withByNameInclusion instead

public abstract BeanDeserializerBase
withIgnoreAllUnknown(boolean ignoreUnknown)

public abstract BeanDeserializerBase
public <T> T
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 IOException, or an unchecked exception.

protected <T> T
Inherited from com.fasterxml.jackson.databind.deser.std.StdDeserializer:
_byteOverflow_checkBooleanToStringCoercion_checkCoercionFail_checkDoubleSpecialValue_checkFloatSpecialValue_checkFloatToIntCoercion_checkFloatToStringCoercion_checkFromStringCoercion_checkFromStringCoercion_checkIntToFloatCoercion_checkIntToStringCoercion_checkTextualNull_checkToStringCoercion_coerceBooleanFromInt_coercedTypeDesc_coercedTypeDesc_coerceEmptyString_coerceIntegral_coerceNullToken_coerceTextualNull_deserializeFromArray_deserializeFromEmpty_deserializeFromEmptyString_deserializeFromString_deserializeWrappedValue_failDoubleToIntCoercion_findCoercionFromBlankString_findCoercionFromEmptyArray_findCoercionFromEmptyString_findNullProvider_hasTextualNull_intOverflow_isBlank_isEmptyOrTextualNull_isFalse_isIntNumber_isNaN_isNegInf_isPosInf_isTrue_neitherNull_nonNullNumber_parseBoolean_parseBooleanFromInt_parseBooleanPrimitive_parseBooleanPrimitive_parseBytePrimitive_parseDate_parseDate_parseDateFromArray_parseDouble_parseDouble_parseDoublePrimitive_parseDoublePrimitive_parseDoublePrimitive_parseFloatPrimitive_parseFloatPrimitive_parseFloatPrimitive_parseInteger_parseInteger_parseIntPrimitive_parseIntPrimitive_parseLong_parseLong_parseLongPrimitive_parseLongPrimitive_parseShortPrimitive_parseString_parseString_reportFailedNullCoerce_shortOverflow_verifyEndArrayForSingle_verifyNullForPrimitive_verifyNullForPrimitiveCoercion_verifyNullForScalarCoercion_verifyNumberForScalarCoercion_verifyStringForScalarCoercionfindContentNullProviderfindContentNullStylefindConvertingContentDeserializerfindDeserializerfindFormatFeaturefindFormatOverridesfindValueNullProvidergetValueClassgetValueTypehandleMissingEndArrayForSinglehandleNestedArrayForSingleisDefaultDeserializerisDefaultKeyDeserializer