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

public abstract Class StdDeserializer<T>

extends JsonDeserializer<T>
implements Serializable, Gettable
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.deser.ValueInstantiator.Gettable, java.io.Serializable
Known Direct Subclasses
com.fasterxml.jackson.databind.deser.std.StdNodeBasedDeserializer, com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer, com.fasterxml.jackson.databind.deser.std.StringArrayDeserializer, com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer, com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer.Vanilla, com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializerNR, com.fasterxml.jackson.databind.deser.BeanDeserializerBase, com.fasterxml.jackson.databind.deser.impl.FailingDeserializer, com.fasterxml.jackson.databind.deser.impl.UnsupportedTypeDeserializer, com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase, com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer, com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer, com.fasterxml.jackson.databind.deser.std.FactoryBasedEnumDeserializer, com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer, com.fasterxml.jackson.databind.deser.std.NullifyingDeserializer, com.fasterxml.jackson.databind.deser.std.PrimitiveArrayDeserializers, com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer, com.fasterxml.jackson.databind.deser.std.StdDelegatingDeserializer
Imports
java.io.IOException, java.util.*, com.fasterxml.jackson.annotation.JsonFormat, .Nulls, com.fasterxml.jackson.core.*, .JsonParser.NumberType, com.fasterxml.jackson.core.exc.StreamReadException, com.fasterxml.jackson.core.io.NumberInput, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.annotation.JacksonStdImpl, com.fasterxml.jackson.databind.cfg.CoercionAction, .CoercionInputShape, com.fasterxml.jackson.databind.deser.BeanDeserializerBase, .NullValueProvider, .SettableBeanProperty, .ValueInstantiator, com.fasterxml.jackson.databind.deser.impl.NullsAsEmptyProvider, .NullsConstantProvider, .NullsFailProvider, com.fasterxml.jackson.databind.introspect.AnnotatedMember, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.fasterxml.jackson.databind.type.LogicalType, com.fasterxml.jackson.databind.util.AccessPattern, .ClassUtil, .Converter

Base class for common deserializers. Contains shared base functionality for dealing with primitive values, such as (re)parsing from String.

Field Summary

Modifier and TypeField and Description
protected final Class<?>
_valueClass

Type of values this deserializer handles: sometimes exact types, other time most specific supertype of types deserializer handles (which may be as generic as Object in some case)

protected final JavaType
protected static final int
protected static final int
F_MASK_INT_COERCIONS

Bitmask that covers DeserializationFeature#USE_BIG_INTEGER_FOR_INTS and DeserializationFeature#USE_LONG_FOR_INTS, used for more efficient cheks when coercing integral values for untyped deserialization.

private static final long

Constructor Summary

AccessConstructor and Description
protected
protected
protected
StdDeserializer(StdDeserializer<?> src)

Copy-constructor for sub-classes to use, most often when creating new instances for com.fasterxml.jackson.databind.deser.ContextualDeserializer.

Method Summary

Modifier and TypeMethod and Description
protected final boolean
_byteOverflow(int value)

protected CoercionAction
protected CoercionAction
_checkCoercionFail(DeserializationContext ctxt, CoercionAction act, Class<?> targetType, Object inputValue, String inputDesc)

protected Double

Returns:

One of Double constants referring to special value decoded, if value matched; null otherwise.
_checkDoubleSpecialValue
(String
String value to check
text
)

Helper method called to check whether given String value contains one of "special" values (currently, NaN ("not-a-number") and plus/minus Infinity) and if so, returns that value; otherwise returns null.

protected Float

Returns:

One of Float constants referring to special value decoded, if value matched; null otherwise.
_checkFloatSpecialValue
(String
String value to check
text
)

Helper method called to check whether given String value contains one of "special" values (currently, NaN ("not-a-number") and plus/minus Infinity) and if so, returns that value; otherwise returns null.

protected CoercionAction
protected CoercionAction
protected CoercionAction
protected CoercionAction
_checkFromStringCoercion(DeserializationContext ctxt, String value, LogicalType logicalType, Class<?> rawTargetType)

protected CoercionAction
protected CoercionAction
protected boolean
_checkTextualNull(DeserializationContext ctxt, String text)

Method called when otherwise unrecognized String value is encountered for a non-primitive type: should see if it is String value "null", and if so, whether it is acceptable according to configuration or not

protected CoercionAction
_checkToStringCoercion(JsonParser p, DeserializationContext ctxt, Class<?> rawTargetType, Object inputValue, CoercionInputShape inputShape)

protected Boolean
protected String

Returns:

Message with backtick-enclosed name of type this deserializer supports
_coercedTypeDesc
()

Helper method called to get a description of type into which a scalar value coercion is (most likely) being applied, to be used for constructing exception messages on coerce failure.

protected String

Returns:

Message with backtick-enclosed name of target type
_coercedTypeDesc
(Class<?> rawTargetType)

Helper method called to get a description of type into which a scalar value coercion is being applied, to be used for constructing exception messages on coerce failure.

protected Object
_coerceEmptyString(DeserializationContext ctxt, boolean isPrimitive)

Deprecated Since 2.12
Method called when JSON String with value "" (that is, zero length) is encountered.
protected Object
_coerceIntegral(JsonParser p, DeserializationContext ctxt)

Helper method called in case where an integral number is encountered, but config settings suggest that a coercion may be needed to "upgrade" java.lang.Number into "bigger" type like java.lang.Long or java.math.BigInteger

protected Object
_coerceNullToken(DeserializationContext ctxt, boolean isPrimitive)

Deprecated
protected Object
_coerceTextualNull(DeserializationContext ctxt, boolean isPrimitive)

Deprecated
protected T
_deserializeFromArray(JsonParser p, DeserializationContext ctxt)

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 T
_deserializeFromEmpty(JsonParser p, DeserializationContext ctxt)

Deprecated Since 2.12
Helper method that may be used to support fallback for Empty String / Empty Array non-standard representations; usually for things serialized as JSON Objects.
protected Object
protected T
_deserializeFromString(JsonParser p, DeserializationContext ctxt)

Helper method to call in case deserializer does not support native automatic use of incoming String values, but there may be standard coercions to consider.

protected T
_deserializeWrappedValue(JsonParser p, DeserializationContext ctxt)

Helper called to support DeserializationFeature#UNWRAP_SINGLE_VALUE_ARRAYS: default implementation simply calls deserialize(JsonParser, DeserializationContext), but handling may be overridden.

protected void
protected CoercionAction
protected CoercionAction
protected CoercionAction
protected final NullValueProvider
protected boolean
_hasTextualNull(String value)

Helper method called to determine if we are seeing String value of "null", and, further, that it should be coerced to null just like null token.

protected final boolean
_intOverflow(long value)

protected static final boolean
protected boolean
_isEmptyOrTextualNull(String value)

Deprecated
protected boolean
protected final boolean
_isIntNumber(String text)

Helper method to check whether given text refers to what looks like a clean simple integer number, consisting of optional sign followed by a sequence of digits.

protected final boolean
_isNaN(String text)

protected final boolean
protected final boolean
protected boolean
protected static final boolean
protected Number
protected final Boolean
_parseBoolean(JsonParser
Underlying parser
p
,
DeserializationContext
Deserialization context for accessing configuration
ctxt
,
Class<?>
Actual type that is being deserialized, may be same as handledType but could be AtomicBoolean for example. Used for coercion config access.
targetType
)

Helper method called for cases where non-primitive, boolean-based value is to be deserialized: result of this method will be java.lang.Boolean, although actual target type may be something different.

protected boolean
protected final boolean
protected final boolean
_parseBooleanPrimitive(JsonParser
Underlying parser
p
,
DeserializationContext
Deserialization context for accessing configuration
ctxt
)

protected final byte
protected Date
protected Date
protected Date
protected static final double
_parseDouble(final String numStr)

Helper method for encapsulating calls to low-level double value parsing; single place just because we need a work-around that must be applied to all calls.

protected static final double
_parseDouble(final String numStr, final boolean useFastParser)

Helper method for encapsulating calls to low-level double value parsing; single place just because we need a work-around that must be applied to all calls.

protected final double
protected final double
protected final double
protected final float
protected final float
protected final float
protected final Integer
protected final Integer
protected final int
protected final int
protected final Long
protected final Long
protected final long
protected final long
protected final short
protected final String
_parseString(JsonParser p, DeserializationContext ctxt)

Deprecated Since 2.14 (use the non-deprecated overload)
protected final String
_parseString(JsonParser
Currently active parser being iterated over
p
,
DeserializationContext
Deserialization context
ctxt
,
NullValueProvider
Entity we (only) need for case of secondary value type being coerced into null: if so, provider is asked for possible "null replacement" value.
nullProvider
)

Helper method used for deserializing String value, if possible, doing necessary conversion or throwing exception as necessary.

protected void
_reportFailedNullCoerce(DeserializationContext ctxt, boolean state, Enum<?> feature, String inputDesc)

protected final boolean
_shortOverflow(int value)

protected void
protected final void
_verifyNullForPrimitive(DeserializationContext ctxt)

Method called to verify that null token from input is acceptable for primitive (unboxed) target type.

protected final void
_verifyNullForPrimitiveCoercion(DeserializationContext ctxt, String str)

Method called to verify that text value "null" from input is acceptable for primitive (unboxed) target type.

protected final void
protected void
protected void
public Object
deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer
Deserializer to use for handling type information
typeDeserializer
)

Overrides com.fasterxml.jackson.databind.JsonDeserializer.deserializeWithType.

Base implementation that does not assume specific type inclusion mechanism.
protected NullValueProvider
findContentNullProvider(DeserializationContext ctxt, BeanProperty prop, JsonDeserializer<?> valueDeser)

Method called to find NullValueProvider for a contents of a structured primary property (Collection, Map, array), using "content nulls" setting.

protected Nulls
protected JsonDeserializer<?>
findConvertingContentDeserializer(DeserializationContext ctxt, BeanProperty prop, JsonDeserializer<?>
(optional) configured content serializer if one already exists.
existingDeserializer
)

Helper method that can be used to see if specified property has annotation indicating that a converter is to be used for contained values (contents of structured types; array/List/Map values)

protected JsonDeserializer<Object>
findDeserializer(DeserializationContext ctxt, JavaType
Type of property to deserialize
type
,
BeanProperty
Actual property object (field, method, constuctor parameter) used for passing deserialized values; provided so deserializer can be contextualized if necessary
property
)

Helper method used to locate deserializers for properties the type this deserializer handles contains (usually for properties of bean types)

protected Boolean
findFormatFeature(DeserializationContext ctxt, BeanProperty prop, Class<?>
Type (erased) used for finding default format settings, if any
typeForDefaults
,
JsonFormat.Feature feat)

Convenience method that uses findFormatOverrides to find possible defaults and/of overrides, and then calls JsonFormat.Value.getFeature(feat) to find whether that feature has been specifically marked as enabled or disabled.

protected JsonFormat.Value
findFormatOverrides(DeserializationContext ctxt, BeanProperty prop, Class<?>
Type (erased) used for finding default format settings, if any
typeForDefaults
)

Helper method that may be used to find if this deserializer has specific JsonFormat settings, either via property, or through type-specific defaulting.

protected final NullValueProvider
findValueNullProvider(DeserializationContext ctxt, SettableBeanProperty prop, PropertyMetadata propMetadata)

Method called to find NullValueProvider for a primary property, using "value nulls" setting.

public final Class<?>
getValueClass()

Deprecated Since 2.3 use handledType instead
public ValueInstantiator
public JavaType
getValueType()

Exact structured type this deserializer handles, if known.

public JavaType
getValueType(DeserializationContext ctxt)

Convenience method for getting handled type as JavaType, regardless of whether deserializer has one already resolved (and accessible via getValueType()) or not: equivalent to:

   if (getValueType() != null) {
        return getValueType();
   }
   return ctxt.constructType(handledType());
public Class<?>
handledType()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.handledType.

Method for accessing concrete physical type of values this deserializer produces.
protected void
protected Object
handleNestedArrayForSingle(JsonParser p, DeserializationContext ctxt)

Helper method called when detecting a deep(er) nesting of Arrays when trying to unwrap value for DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS.

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.
instanceOrClass
,
String
Name of the property that cannot be mapped
propName
)

Method called to deal with a property that did not map to a known Bean property.

protected boolean
isDefaultDeserializer(JsonDeserializer<?> deserializer)

Method that can be called to determine if given deserializer is the default deserializer Jackson uses; as opposed to a custom deserializer installed by a module or calling application.

protected boolean
Inherited from com.fasterxml.jackson.databind.JsonDeserializer:
deserializedeserializedeserializeWithTypefindBackReferencegetAbsentValuegetDelegateegetEmptyAccessPatterngetEmptyValuegetEmptyValuegetKnownPropertyNamesgetNullAccessPatterngetNullValuegetNullValuegetObjectIdReaderisCachablelogicalTypereplaceDelegateesupportsUpdateunwrappingDeserializer