Class JsonNodeDeserializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<T>
-
- com.fasterxml.jackson.databind.deser.std.StdDeserializer<T>
-
- com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer<JsonNode>
-
- com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer
-
- All Implemented Interfaces:
NullValueProvider
,java.io.Serializable
public class JsonNodeDeserializer extends BaseNodeDeserializer<JsonNode>
Deserializer that can build instances ofJsonNode
from any JSON content, using appropriateJsonNode
type.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
JsonNodeDeserializer.ArrayDeserializer
(package private) static class
JsonNodeDeserializer.ObjectDeserializer
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
JsonDeserializer.None
-
-
Field Summary
Fields Modifier and Type Field Description private static JsonNodeDeserializer
instance
Singleton instance of generic deserializer forJsonNode
.-
Fields inherited from class com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer
_supportsUpdates
-
Fields inherited from class com.fasterxml.jackson.databind.deser.std.StdDeserializer
_valueClass, _valueType, F_MASK_ACCEPT_ARRAYS, F_MASK_INT_COERCIONS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JsonNodeDeserializer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonNode
deserialize(com.fasterxml.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).static JsonDeserializer<? extends JsonNode>
getDeserializer(java.lang.Class<?> nodeClass)
Factory method for accessing deserializer for specific node typeJsonNode
getNullValue(DeserializationContext ctxt)
Method that can be called to determine value to be used for representing null values (values deserialized when JSON token isJsonToken.VALUE_NULL
).-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer
_fromEmbedded, _fromFloat, _fromInt, _handleDuplicateField, deserializeAny, deserializeArray, deserializeObject, deserializeObjectAtName, deserializeWithType, isCachable, supportsUpdate, updateArray, updateObject
-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.StdDeserializer
_byteOverflow, _coercedTypeDesc, _coerceEmptyString, _coerceIntegral, _coerceNullToken, _coerceTextualNull, _deserializeFromArray, _deserializeFromEmpty, _deserializeWrappedValue, _failDoubleToIntCoercion, _findNullProvider, _hasTextualNull, _intOverflow, _isEmptyOrTextualNull, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _neitherNull, _nonNullNumber, _parseBooleanFromInt, _parseBooleanPrimitive, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseIntPrimitive, _parseIntPrimitive, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _verifyNullForScalarCoercion, _verifyNumberForScalarCoercion, _verifyStringForScalarCoercion, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueClass, getValueType, getValueType, handledType, handleMissingEndArrayForSingle, handleNestedArrayForSingle, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer, parseDouble
-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, findBackReference, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getObjectIdReader, replaceDelegatee, unwrappingDeserializer
-
-
-
-
Field Detail
-
instance
private static final JsonNodeDeserializer instance
Singleton instance of generic deserializer forJsonNode
. Only used for types other than JSON Object and Array.
-
-
Method Detail
-
getDeserializer
public static JsonDeserializer<? extends JsonNode> getDeserializer(java.lang.Class<?> nodeClass)
Factory method for accessing deserializer for specific node type
-
getNullValue
public JsonNode getNullValue(DeserializationContext ctxt)
Description copied from class:JsonDeserializer
Method 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
JsonDeserializer.getNullAccessPattern()
returns.Default implementation simply returns null.
- Specified by:
getNullValue
in interfaceNullValueProvider
- Overrides:
getNullValue
in classJsonDeserializer<JsonNode>
-
deserialize
public JsonNode deserialize(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt) throws java.io.IOException
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:
deserialize
in classJsonDeserializer<JsonNode>
- Parameters:
p
- Parsed used for reading JSON contentctxt
- Context that can be used to access information about this deserialization activity.- Returns:
- Deserialized value
- Throws:
java.io.IOException
-
-