Package org.springframework.boot.jackson
Class JsonObjectDeserializer<T>
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<T>
org.springframework.boot.jackson.JsonObjectDeserializer<T>
- Type Parameters:
- T- the supported object type
- All Implemented Interfaces:
- com.fasterxml.jackson.databind.deser.NullValueProvider
public abstract class JsonObjectDeserializer<T>
extends com.fasterxml.jackson.databind.JsonDeserializer<T>
Helper base class for 
JsonDeserializer implementations that deserialize
 objects.- Since:
- 1.4.0
- Author:
- Phillip Webb
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializercom.fasterxml.jackson.databind.JsonDeserializer.None
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal Tdeserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) protected abstract TdeserializeObject(com.fasterxml.jackson.core.JsonParser jsonParser, com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.core.ObjectCodec codec, com.fasterxml.jackson.databind.JsonNode tree) Deserialize JSON content into the value type this serializer handles.protected final com.fasterxml.jackson.databind.JsonNodegetRequiredNode(com.fasterxml.jackson.databind.JsonNode tree, String fieldName) Helper method to return aJsonNodefrom the tree.protected final <D> DnullSafeValue(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<D> type) Helper method to extract a value from the givenjsonNodeor returnnullwhen the node itself isnull.protected final <D,R> R nullSafeValue(com.fasterxml.jackson.databind.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 com.fasterxml.jackson.databind.JsonDeserializerdeserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
- 
Constructor Details- 
JsonObjectDeserializerpublic JsonObjectDeserializer()
 
- 
- 
Method Details- 
deserializepublic final T deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException - Specified by:
- deserializein class- com.fasterxml.jackson.databind.JsonDeserializer<T>
- Throws:
- IOException
 
- 
deserializeObjectprotected abstract T deserializeObject(com.fasterxml.jackson.core.JsonParser jsonParser, com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.core.ObjectCodec codec, com.fasterxml.jackson.databind.JsonNode tree) throws IOException Deserialize JSON content into the value type this serializer handles.- Parameters:
- jsonParser- the source parser used for reading JSON content
- context- context that can be used to access information about this deserialization activity
- codec- the- ObjectCodecassociated with the parser
- tree- deserialized JSON content as tree expressed using set of- TreeNodeinstances
- Returns:
- the deserialized object
- Throws:
- IOException- on error
- See Also:
 
- 
nullSafeValueprotected final <D,R> R nullSafeValue(com.fasterxml.jackson.databind.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 requested
- R- the result type
- Parameters:
- jsonNode- the source node (may be- null)
- type- the data type. May be- String,- Boolean,- Long,- Integer,- Short,- Double,- Float,- BigDecimalor- BigInteger.
- mapper- a mapper to convert the value when it is not- null
- Returns:
- the node value or null
- Since:
- 3.4.0
 
- 
nullSafeValueprotected final <D> D nullSafeValue(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<D> type) 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 be- null)
- type- the data type. May be- String,- Boolean,- Long,- Integer,- Short,- Double,- Float,- BigDecimalor- BigInteger.
- Returns:
- the node value or null
 
- 
getRequiredNodeprotected final com.fasterxml.jackson.databind.JsonNode getRequiredNode(com.fasterxml.jackson.databind.JsonNode tree, String fieldName) Helper method to return aJsonNodefrom the tree.- Parameters:
- tree- the source tree
- fieldName- the field name to extract
- Returns:
- the JsonNode
 
 
-