Class JsonNodeDeserializer
java.lang.Object
tools.jackson.databind.ValueDeserializer<JsonNode>
tools.jackson.databind.deser.std.StdDeserializer<JsonNode>
tools.jackson.databind.deser.jackson.BaseNodeDeserializer<JsonNode>
tools.jackson.databind.deser.jackson.JsonNodeDeserializer
- All Implemented Interfaces:
NullValueProvider, ValueInstantiator.Gettable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classImplementation used when declared type is specificallyArrayNode.(package private) static final classImplementation used when declared type is specificallyObjectNode.Nested classes/interfaces inherited from class BaseNodeDeserializer
BaseNodeDeserializer.ContainerStackNested classes/interfaces inherited from class ValueDeserializer
ValueDeserializer.None -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final JsonNodeDeserializerSingleton instance of generic deserializer forJsonNode.Fields inherited from class BaseNodeDeserializer
_mergeArrays, _mergeObjects, _supportsUpdatesFields inherited from class StdDeserializer
_valueClass, _valueType, F_MASK_INT_COERCIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedJsonNodeDeserializer(JsonNodeDeserializer base, boolean mergeArrays, boolean mergeObjects) -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseNodeDeserializer<?> _createWithMerge(boolean mergeArrays, boolean mergeObjects) deserialize(tools.jackson.core.JsonParser p, DeserializationContext ctxt) Implementation that will produce types of any JSON nodes; not just one deserializer is registered to handle (in case of more specialized handler).Overridden variant to ensure that absent values are NOT coerced intoNullNodes, unlike incomingnullvalues.static BaseNodeDeserializer<?> getDeserializer(Class<?> nodeClass) Factory method for accessing deserializer for specific node typeMethod that can be called to determine value to be used for representing null values (values deserialized when JSON token isJsonToken.VALUE_NULL).supportsUpdate(DeserializationConfig config) Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not.Methods inherited from class BaseNodeDeserializer
_deserializeAnyScalar, _deserializeContainerNoRecursion, _deserializeObjectAtName, _deserializeRareScalar, _fromEmbedded, _fromFloat, _fromInt, _fromInt, _handleDuplicateProperty, _normalize, createContextual, deserializeWithType, isCachable, logicalType, updateObjectMethods inherited from class StdDeserializer
_byteOverflow, _checkBooleanToStringCoercion, _checkCoercionFail, _checkDoubleSpecialValue, _checkFloatSpecialValue, _checkFloatToIntCoercion, _checkFloatToStringCoercion, _checkFromStringCoercion, _checkFromStringCoercion, _checkIntToFloatCoercion, _checkIntToStringCoercion, _checkTextualNull, _checkToStringCoercion, _coerceBooleanFromInt, _coercedTypeDesc, _coercedTypeDesc, _coerceIntegral, _deserializeFromArray, _deserializeFromEmptyString, _deserializeFromString, _deserializeFromStringForContainer, _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, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _wrapIOFailure, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatFeature, findFormatOverrides, findFormatOverrides, findValueNullProvider, getValueInstantiator, getValueType, getValueType, handledType, handleMissingEndArrayForSingle, handleNestedArrayForSingle, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer
-
Field Details
-
instance
Singleton instance of generic deserializer forJsonNode. Only used for types other than JSON Object and Array.
-
-
Constructor Details
-
JsonNodeDeserializer
protected JsonNodeDeserializer() -
JsonNodeDeserializer
protected JsonNodeDeserializer(JsonNodeDeserializer base, boolean mergeArrays, boolean mergeObjects)
-
-
Method Details
-
_createWithMerge
- Specified by:
_createWithMergein classBaseNodeDeserializer<JsonNode>
-
getDeserializer
Factory method for accessing deserializer for specific node type -
getNullValue
Description copied from class:ValueDeserializerMethod that can be called to determine value to be used for representing null values (values deserialized when JSON token isJsonToken.VALUE_NULL). Usually this is simply Java null, but for some types (especially primitives) it may be necessary to use non-null values.This method may be called once, or multiple times, depending on what
ValueDeserializer.getNullAccessPattern()returns.Default implementation simply returns null.
- Specified by:
getNullValuein interfaceNullValueProvider- Overrides:
getNullValuein classValueDeserializer<JsonNode>
-
getAbsentValue
Overridden variant to ensure that absent values are NOT coerced intoNullNodes, unlike incomingnullvalues.- Specified by:
getAbsentValuein interfaceNullValueProvider- Overrides:
getAbsentValuein classValueDeserializer<JsonNode>
-
deserialize
public JsonNode deserialize(tools.jackson.core.JsonParser p, DeserializationContext ctxt) throws tools.jackson.core.JacksonException Implementation that will produce types of any JSON nodes; not just one deserializer is registered to handle (in case of more specialized handler). Overridden by typed sub-classes for more thorough checking- Specified by:
deserializein classValueDeserializer<JsonNode>- Parameters:
p- Parser used for reading JSON contentctxt- Context that can be used to access information about this deserialization activity.- Returns:
- Deserialized value
- Throws:
tools.jackson.core.JacksonException
-
supportsUpdate
Description copied from class:ValueDeserializerIntrospection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not. Return value should either beBoolean.FALSEif update is not supported at all (immutable values);Boolean.TRUEif update should usually work (regular POJOs, for example), ornullif 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.FALSEreturned, or inclusion ifBoolean.TRUEis specified. If "unknown" case (nullreturned) behavior is to exclude property if global defaults used; or to allow if explicit per-type or property merging is defined.Default implementation returns
nullto allow explicit per-type or per-property attempts.- Overrides:
supportsUpdatein classBaseNodeDeserializer<JsonNode>
-