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

public abstract Class BaseNodeDeserializer<T extends JsonNode>

extends StdDeserializer<T extends JsonNode>
Class Inheritance
Known Direct Subclasses
tools.jackson.databind.deser.jackson.JsonNodeDeserializer, tools.jackson.databind.deser.jackson.JsonNodeDeserializer.ObjectDeserializer, tools.jackson.databind.deser.jackson.JsonNodeDeserializer.ArrayDeserializer
Imports
java.math.BigDecimal, java.util.Arrays, tools.jackson.core.*, tools.jackson.databind.*, tools.jackson.databind.cfg.DatatypeFeatures, .JsonNodeFeature, tools.jackson.databind.deser.std.StdDeserializer, tools.jackson.databind.jsontype.TypeDeserializer, tools.jackson.databind.node.ArrayNode, .ContainerNode, .JsonNodeFactory, .ObjectNode, tools.jackson.databind.type.LogicalType, tools.jackson.databind.util.RawValue

Base class for all actual JsonNode deserializer implementations. Uses iteration instead of recursion: this allows handling of very deeply nested input structures.

This class should only be extended by internal Jackson deserializers. It is not intended to be used by custom deserializers.

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 tools.jackson.databind.deser.std.StdDeserializer:
_valueClass_valueTypeF_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 BaseNodeDeserializer<?>
_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 PROPERTY_NAME and not START_OBJECT.

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

protected final JsonNode
protected void
_handleDuplicateProperty(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory, String
Name of the property for which duplicate value was found
propName
,
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 an Object property.

protected BigDecimal
private static boolean
_shouldMerge(Boolean specificMerge, Boolean generalMerge)

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

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

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

Base implementation that does not assume specific type inclusion mechanism.

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 LogicalType
logicalType()

Overrides tools.jackson.databind.ValueDeserializer.logicalType.

Method for accessing logical type of values this deserializer produces.

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.

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 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_wrapIOFailurefindContentNullProviderfindContentNullStylefindConvertingContentDeserializerfindDeserializerfindFormatFeaturefindFormatOverridesfindValueNullProvidergetValueInstantiatorgetValueTypegetValueTypehandledTypehandleMissingEndArrayForSinglehandleNestedArrayForSinglehandleUnknownPropertyisDefaultDeserializerisDefaultKeyDeserializer

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 BaseNodeDeserializer<?> _createWithMerge(boolean mergeArrays, boolean mergeObjects)
_deserializeAnyScalarback to summary
protected final JsonNode _deserializeAnyScalar(JsonParser p, DeserializationContext ctxt) throws JacksonException
_deserializeContainerNoRecursionback to summary
protected final ContainerNode<?> _deserializeContainerNoRecursion(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory, BaseNodeDeserializer.ContainerStack stack, final ContainerNode<?> root) throws JacksonException
_deserializeObjectAtNameback to summary
protected final ObjectNode _deserializeObjectAtName(JsonParser p, DeserializationContext ctxt, final JsonNodeFactory nodeFactory, final BaseNodeDeserializer.ContainerStack stack) throws JacksonException

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

_deserializeRareScalarback to summary
protected final JsonNode _deserializeRareScalar(JsonParser p, DeserializationContext ctxt) throws JacksonException
_fromEmbeddedback to summary
protected final JsonNode _fromEmbedded(JsonParser p, DeserializationContext ctxt) throws JacksonException
_fromFloatback to summary
protected final JsonNode _fromFloat(JsonParser p, DeserializationContext ctxt, final JsonNodeFactory nodeFactory) throws JacksonException
_fromIntback to summary
protected final JsonNode _fromInt(JsonParser p, int coercionFeatures, JsonNodeFactory nodeFactory) throws JacksonException
_fromIntback to summary
protected final JsonNode _fromInt(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory) throws JacksonException
_handleDuplicatePropertyback to summary
protected void _handleDuplicateProperty(JsonParser p, DeserializationContext ctxt, JsonNodeFactory nodeFactory, String propName, ObjectNode objectNode, JsonNode oldValue, JsonNode newValue) throws JacksonException

Method called when there is a duplicate value for an Object property. 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
propName:String

Name of the property 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

_normalizeback to summary
protected BigDecimal _normalize(BigDecimal nr)
_shouldMergeback to summary
private static boolean _shouldMerge(Boolean specificMerge, Boolean generalMerge)
createContextualback to summary
public ValueDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property)

Overrides tools.jackson.databind.ValueDeserializer.createContextual.

Doc from tools.jackson.databind.ValueDeserializer.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.

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

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

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

Annotations
@Override
isCachableback to summary
public boolean isCachable()

Overrides tools.jackson.databind.ValueDeserializer.isCachable.

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

Note that cached instances are still contextualized on per-property basis (but note that ValueDeserializer#resolve(DeserializationContext)d just once!) 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 tools.jackson.databind.ValueDeserializer.logicalType.

Doc from tools.jackson.databind.ValueDeserializer.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.

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

Overrides tools.jackson.databind.ValueDeserializer.supportsUpdate.

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

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

tools.jackson.databind.deser.jackson back to summary

pack-priv final Class BaseNodeDeserializer.ContainerStack

extends Object
Class Inheritance
  • java.lang.Object
  • tools.jackson.databind.deser.jackson.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()