类 JsonObjectDeserializer<T>
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<T>
org.springframework.boot.jackson.JsonObjectDeserializer<T>
- 类型参数:
T
- the supported object type
- 所有已实现的接口:
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.- 从以下版本开始:
- 1.4.0
- 作者:
- Phillip Webb
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final T
deserialize
(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) protected 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) Deserialize JSON content into the value type this serializer handles.protected final com.fasterxml.jackson.databind.JsonNode
getRequiredNode
(com.fasterxml.jackson.databind.JsonNode tree, String fieldName) Helper method to return aJsonNode
from the tree.protected final <D> D
nullSafeValue
(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<D> type) Helper method to extract a value from the givenjsonNode
or returnnull
when 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 givenjsonNode
or returnnull
when the node itself isnull
.从类继承的方法 com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
构造器详细资料
-
JsonObjectDeserializer
public JsonObjectDeserializer()
-
-
方法详细资料
-
deserialize
public final T deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException - 指定者:
deserialize
在类中com.fasterxml.jackson.databind.JsonDeserializer<T>
- 抛出:
IOException
-
deserializeObject
protected 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.- 参数:
jsonParser
- the source parser used for reading JSON contentcontext
- context that can be used to access information about this deserialization activitycodec
- theObjectCodec
associated with the parsertree
- deserialized JSON content as tree expressed using set ofTreeNode
instances- 返回:
- the deserialized object
- 抛出:
IOException
- on error- 另请参阅:
-
nullSafeValue
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 givenjsonNode
or returnnull
when the node itself isnull
.- 类型参数:
D
- the data type requestedR
- the result type- 参数:
jsonNode
- the source node (may benull
)type
- the data type. May beString
,Boolean
,Long
,Integer
,Short
,Double
,Float
,BigDecimal
orBigInteger
.mapper
- a mapper to convert the value when it is notnull
- 返回:
- the node value or
null
- 从以下版本开始:
- 3.4.0
-
nullSafeValue
protected final <D> D nullSafeValue(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<D> type) Helper method to extract a value from the givenjsonNode
or returnnull
when the node itself isnull
.- 类型参数:
D
- the data type requested- 参数:
jsonNode
- the source node (may benull
)type
- the data type. May beString
,Boolean
,Long
,Integer
,Short
,Double
,Float
,BigDecimal
orBigInteger
.- 返回:
- the node value or
null
-
getRequiredNode
protected final com.fasterxml.jackson.databind.JsonNode getRequiredNode(com.fasterxml.jackson.databind.JsonNode tree, String fieldName) Helper method to return aJsonNode
from the tree.- 参数:
tree
- the source treefieldName
- the field name to extract- 返回:
- the
JsonNode
-