Class ObjectValueDeserializer<T>
java.lang.Object
tools.jackson.databind.ValueDeserializer<T>
org.springframework.boot.jackson.ObjectValueDeserializer<T>
- Type Parameters:
T- the supported object type
- All Implemented Interfaces:
NullValueProvider
Helper base class for
ValueDeserializer implementations that deserialize
objects.- Since:
- 4.0.0
- Author:
- Phillip Webb
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ValueDeserializer
ValueDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Tdeserialize(JsonParser jp, DeserializationContext ctxt) protected abstract TdeserializeObject(JsonParser jsonParser, DeserializationContext context, JsonNode tree) Deserialize JSON content into the value type this serializer handles.protected final JsonNodegetRequiredNode(JsonNode tree, String fieldName) Helper method to return aJsonNodefrom the tree.protected final <D> @Nullable DnullSafeValue(@Nullable JsonNode jsonNode, Class<D> type) Helper method to extract a value from the givenjsonNodeor returnnullwhen the node itself isnull.protected final <D,R> @Nullable R nullSafeValue(@Nullable JsonNode jsonNode, Class<D> type, Function<D, R> mapper) Helper method to extract a value from the givenjsonNodeor returnnullwhen the node itself isnull.Methods inherited from class ValueDeserializer
createContextual, deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, resolve, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
ObjectValueDeserializer
public ObjectValueDeserializer()
-
-
Method Details
-
deserialize
- Specified by:
deserializein classValueDeserializer<T>
-
deserializeObject
protected abstract T deserializeObject(JsonParser jsonParser, DeserializationContext context, JsonNode tree) Deserialize JSON content into the value type this serializer handles.- Parameters:
jsonParser- the source parser used for reading JSON contentcontext- context that can be used to access information about this deserialization activitytree- deserialized JSON content as tree expressed using set ofTreeNodeinstances- Returns:
- the deserialized object
- See Also:
-
nullSafeValue
protected final <D,R> @Nullable R nullSafeValue(@Nullable JsonNode jsonNode, Class<D> type, Function<D, R> mapper) Helper method to extract a value from the givenjsonNodeor returnnullwhen the node itself isnull.- Type Parameters:
D- the data type requestedR- the result type- Parameters:
jsonNode- the source node (may benull)type- the data type. May beString,Boolean,Long,Integer,Short,Double,Float,BigDecimalorBigInteger.mapper- a mapper to convert the value when it is notnull- Returns:
- the node value or
null
-
nullSafeValue
Helper method to extract a value from the givenjsonNodeor returnnullwhen the node itself isnull.- Type Parameters:
D- the data type requested- Parameters:
jsonNode- the source node (may benull)type- the data type. May beString,Boolean,Long,Integer,Short,Double,Float,BigDecimalorBigInteger.- Returns:
- the node value or
null
-
getRequiredNode
-