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

pack-priv abstract Class BaseNodeDeserializer<T extends com.fasterxml.jackson.databind.JsonNode>

Located in compilation unit of com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.

extends StdDeserializer<T extends JsonNode>
implements ContextualDeserializer
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.deser.ContextualDeserializer
Known Direct Subclasses
com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer, com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.ObjectDeserializer, com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.ArrayDeserializer
Annotations
@SuppressWarnings:serial

Base class for all actual JsonNode deserializer implementations.

Starting with Jackson 2.13 uses iteration instead of recursion: this allows handling of very deeply nested input structures.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
BaseNodeDeserializer.ContainerStack

Optimized variant similar in functionality to (a subset of) java.util.ArrayDeque; used to hold enclosing Array/Object nodes during recursion-as-iteration.

Field Summary

Modifier and TypeField and Description
protected final boolean
protected final boolean
protected final Boolean
Inherited from com.fasterxml.jackson.databind.deser.std.StdDeserializer:
_valueClass_valueTypeF_MASK_ACCEPT_ARRAYSF_MASK_INT_COERCIONS

Constructor Summary

AccessConstructor and Description
public
BaseNodeDeserializer(Class<T> vc, Boolean supportsUpdates)

protected
BaseNodeDeserializer(BaseNodeDeserializer<?> base, boolean mergeArrays, boolean mergeObjects)

Method Summary

Modifier and TypeMethod and Description
protected abstract JsonDeserializer<?>
_createWithMerge(boolean mergeArrays, boolean mergeObjects)

protected final JsonNode
protected final ContainerNode<?>
protected final ObjectNode
_deserializeObjectAtName(JsonParser p, DeserializationContext ctxt, final JsonNodeFactory nodeFactory, final BaseNodeDeserializer.ContainerStack stack)

Alternate deserialization method used when parser already points to first FIELD_NAME and not START_OBJECT.

protected final JsonNode
protected final JsonNode
protected final JsonNode
protected final JsonNode
protected final JsonNode
_fromInt(JsonParser p, int coercionFeatures, JsonNodeFactory nodeFactory)

protected final JsonNode
protected void
_handleDuplicateField(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory, String
Name of the field for which duplicate value was found
fieldName
,
ObjectNode
Object node that contains values
objectNode
,
JsonNode
Value that existed for the object node before newValue was added
oldValue
,
JsonNode
Newly added value just added to the object node
newValue
)

Method called when there is a duplicate value for a field.

private static boolean
_shouldMerge(Boolean specificMerge, Boolean generalMerge)

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.

Method called to see if a different (or differently configured) deserializer is needed to deserialize values of specified property.
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 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 LogicalType
logicalType()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.logicalType.

Method for accessing logical type of values this deserializer produces.
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.
protected final JsonNode
updateObject(JsonParser p, DeserializationContext ctxt, final ObjectNode node, final BaseNodeDeserializer.ContainerStack stack)

Alternate deserialization method that is to update existing ObjectNode if possible.

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_verifyStringForScalarCoercionfindContentNullProviderfindContentNullStylefindConvertingContentDeserializerfindDeserializerfindFormatFeaturefindFormatOverridesfindValueNullProvidergetValueClassgetValueInstantiatorgetValueTypegetValueTypehandledTypehandleMissingEndArrayForSinglehandleNestedArrayForSinglehandleUnknownPropertyisDefaultDeserializerisDefaultKeyDeserializer

Field Detail

_mergeArraysback to summary
protected final boolean _mergeArrays
_mergeObjectsback to summary
protected final boolean _mergeObjects
_supportsUpdatesback to summary
protected final Boolean _supportsUpdates

Constructor Detail

BaseNodeDeserializerback to summary
public BaseNodeDeserializer(Class<T> vc, Boolean supportsUpdates)
BaseNodeDeserializerback to summary
protected BaseNodeDeserializer(BaseNodeDeserializer<?> base, boolean mergeArrays, boolean mergeObjects)

Method Detail

_createWithMergeback to summary
protected abstract JsonDeserializer<?> _createWithMerge(boolean mergeArrays, boolean mergeObjects)
_deserializeAnyScalarback to summary
protected final JsonNode _deserializeAnyScalar(JsonParser p, DeserializationContext ctxt) throws IOException
_deserializeContainerNoRecursionback to summary
protected final ContainerNode<?> _deserializeContainerNoRecursion(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory, BaseNodeDeserializer.ContainerStack stack, final ContainerNode<?> root) throws IOException
_deserializeObjectAtNameback to summary
protected final ObjectNode _deserializeObjectAtName(JsonParser p, DeserializationContext ctxt, final JsonNodeFactory nodeFactory, final BaseNodeDeserializer.ContainerStack stack) throws IOException

Alternate deserialization method used when parser already points to first FIELD_NAME and not START_OBJECT.

_deserializeRareScalarback to summary
protected final JsonNode _deserializeRareScalar(JsonParser p, DeserializationContext ctxt) throws IOException
_fromBigDecimalback to summary
protected final JsonNode _fromBigDecimal(DeserializationContext ctxt, JsonNodeFactory nodeFactory, BigDecimal bigDec)
_fromEmbeddedback to summary
protected final JsonNode _fromEmbedded(JsonParser p, DeserializationContext ctxt) throws IOException
_fromFloatback to summary
protected final JsonNode _fromFloat(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory) throws IOException
_fromIntback to summary
protected final JsonNode _fromInt(JsonParser p, int coercionFeatures, JsonNodeFactory nodeFactory) throws IOException
_fromIntback to summary
protected final JsonNode _fromInt(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory) throws IOException
_handleDuplicateFieldback to summary
protected void _handleDuplicateField(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory, String fieldName, ObjectNode objectNode, JsonNode oldValue, JsonNode newValue) throws IOException

Method called when there is a duplicate value for a field. By default we don't care, and the last value is used. Can be overridden to provide alternate handling, such as throwing an exception, or choosing different strategy for combining values or choosing which one to keep.

Parameters
fieldName:String

Name of the field for which duplicate value was found

objectNode:ObjectNode

Object node that contains values

oldValue:JsonNode

Value that existed for the object node before newValue was added

newValue:JsonNode

Newly added value just added to the object node

_shouldMergeback to summary
private static boolean _shouldMerge(Boolean specificMerge, Boolean generalMerge)
createContextualback to summary
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException

Implements com.fasterxml.jackson.databind.deser.ContextualDeserializer.createContextual.

Doc from com.fasterxml.jackson.databind.deser.ContextualDeserializer.createContextual.

Method called to see if a different (or differently configured) deserializer is needed to deserialize values of specified property. Note that instance that this method is called on is typically shared one and as a result method should NOT modify this instance but rather construct and return a new instance. This instance should only be returned as-is, in case it is already suitable for use.

Parameters
ctxt:DeserializationContext

Deserialization context to access configuration, additional deserializers that may be needed by this deserializer

property: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)

Returns:JsonDeserializer<?>

Deserializer to use for deserializing values of specified property; may be this instance or a new instance.

Annotations
@Override
deserializeWithTypeback to summary
public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException

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

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

Base implementation that does not assume specific type inclusion mechanism. Sub-classes are expected to override this method if they are to handle type information.

Parameters
typeDeserializer:TypeDeserializer

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

Deserializer to use for handling type information

Annotations
@Override
isCachableback to summary
public boolean isCachable()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.isCachable.

Doc from 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).

Note that cached instances are still resolved on per-property basis, if instance implements com.fasterxml.jackson.databind.deser.ResolvableDeserializer: cached instance is just as the base. This means that in most cases it is safe to cache instances; however, it only makes sense to cache instances if instantiation is expensive, or if instances are heavy-weight.

Default implementation returns false, to indicate that no caching is done.

Annotations
@Override
logicalTypeback to summary
public LogicalType logicalType()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.logicalType.

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

Method for accessing logical type of values this deserializer produces. Typically used for further configuring handling of values, for example, to find which coercions are legal.

Returns:LogicalType

Logical type of values this deserializer produces, if known; null if not

Annotations
@Override
supportsUpdateback to summary
public Boolean supportsUpdate(DeserializationConfig config)

Overrides com.fasterxml.jackson.databind.JsonDeserializer.supportsUpdate.

Doc from 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. Return value should either be Boolean#FALSE if update is not supported at all (immutable values); Boolean#TRUE if update should usually work (regular POJOs, for example), or null if this is either not known, or may sometimes work.

Information gathered is typically used to either prevent merging update for property (either by skipping, if based on global defaults; or by exception during deserializer construction if explicit attempt made) if Boolean#FALSE returned, or inclusion if Boolean#TRUE is specified. If "unknown" case (null returned) behavior is to exclude property if global defaults used; or to allow if explicit per-type or property merging is defined.

Default implementation returns null to allow explicit per-type or per-property attempts.

Annotations
@Override
updateObjectback to summary
protected final JsonNode updateObject(JsonParser p, DeserializationContext ctxt, final ObjectNode node, final BaseNodeDeserializer.ContainerStack stack) throws IOException

Alternate deserialization method that is to update existing ObjectNode if possible.

Since
2.9
com.fasterxml.jackson.databind.deser.std back to summary

pack-priv final Class BaseNodeDeserializer.ContainerStack

extends Object
Class Inheritance
  • java.lang.Object
  • com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.ContainerStack
Annotations
@SuppressWarnings:rawtypes

Optimized variant similar in functionality to (a subset of) java.util.ArrayDeque; used to hold enclosing Array/Object nodes during recursion-as-iteration.

Field Summary

Modifier and TypeField and Description
private int
private ContainerNode<T extends ContainerNode<T>>[]
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ContainerNode<T extends ContainerNode<T>>
public void
push(ContainerNode<T extends ContainerNode<T>> node)

public int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_endback to summary
private int _end
_stackback to summary
private ContainerNode<T extends ContainerNode<T>>[] _stack
_topback to summary
private int _top

Constructor Detail

ContainerStackback to summary
public ContainerStack()

Method Detail

popOrNullback to summary
public ContainerNode<T extends ContainerNode<T>> popOrNull()
pushback to summary
public void push(ContainerNode<T extends ContainerNode<T>> node)
sizeback to summary
public int size()