ObjectMapper
,
com.fasterxml.jackson.databind.DeserializationContext
)
and classes that construct deserializers
(com.fasterxml.jackson.databind.deser.DeserializerFactory
).
Modifier and Type | Field and Description |
---|---|
protected final LookupCache | _cachedDeserializers
We will also cache some dynamically constructed deserializers; specifically, ones that are expensive to construct. |
protected final HashMap | _incompleteDeserializers
During deserializer construction process we may need to keep track of partially completed deserializers, to resolve cyclic dependencies. |
private final ReentrantLock | _incompleteDeserializersLock
We hold an explicit lock while creating deserializers to avoid creating duplicates. |
public static final int | DEFAULT_MAX_CACHE_SIZE
Default size of the underlying cache to use. |
private static final long |
Access | Constructor and Description |
---|---|
public | |
public | |
public |
Modifier and Type | Method and Description |
---|---|
protected JsonDeserializer | _createAndCache2(DeserializationContext ctxt, DeserializerFactory factory, JavaType type)
Deprecated
Since 2.18 use version of _createAndCache2 that takes `isCustom` flag
Method that handles actual construction (via factory) and caching (both intermediate and eventual) |
protected JsonDeserializer | _createAndCache2(DeserializationContext ctxt, DeserializerFactory factory, JavaType type, boolean isCustom)
|
protected JsonDeserializer | _createAndCacheValueDeserializer(DeserializationContext
Currently active deserialization context ctxt, DeserializerFactory factory, JavaType Type of property to deserialize (never null, callers verify) type)Method that will try to create a deserializer for given type, and resolve and cache it if necessary |
protected JsonDeserializer | _createDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType type)
Method that does the heavy lifting of checking for per-type annotations, find out full type, and figure out which actual factory method to call. |
protected JsonDeserializer | _createDeserializer2(DeserializationContext ctxt, DeserializerFactory factory, JavaType type, BeanDescription beanDesc)
|
protected JsonDeserializer | |
protected KeyDeserializer | |
protected JsonDeserializer | |
private boolean | _hasCustomHandlers(JavaType t)
Helper method used to prevent both caching and cache lookups for structured types that have custom value handlers |
private Class | |
public int | cachedDeserializersCount()
Method that can be used to determine how many deserializers this provider is caching currently (if it does caching: default implementation does) Exact count depends on what kind of deserializers get cached; default implementation caches only dynamically constructed deserializers, but not eagerly constructed standard deserializers (which is different from how serializer provider works). |
public DeserializerCache | |
protected Converter | |
protected JsonDeserializer | findConvertingDeserializer(DeserializationContext ctxt, Annotated a, JsonDeserializer<Object> deser)
Helper method that will check whether given annotated entity (usually class,
but may also be a property accessor) indicates that a |
protected JsonDeserializer | findDeserializerFromAnnotation(DeserializationContext ctxt, Annotated ann)
Helper method called to check if a class or method has annotation that tells which class to use for deserialization. |
public KeyDeserializer | findKeyDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType type)
Method called to get hold of a deserializer to use for deserializing
keys for |
public JsonDeserializer | findValueDeserializer(DeserializationContext
Deserialization context ctxt, DeserializerFactory factory, JavaType Declared type of the value to deserializer (obtained using
'setter' method signature and/or type annotations propertyType)Method called to get hold of a deserializer for a value of given type; or if no such deserializer can be found, a default handler (which may do a best-effort generic serialization or just simply throw an exception when invoked). |
public void | flushCachedDeserializers()
Method that will drop all dynamically constructed deserializers (ones that
are counted as result value for |
public boolean | hasValueDeserializerFor(DeserializationContext ctxt, DeserializerFactory factory, JavaType type)
Method called to find out whether provider would be able to find a deserializer for given type, using a root reference (i.e. not through fields or membership in an array or collection) |
private JavaType | Returns: Original type if no annotations are present; or a more specific type derived from it if type annotation(s) was foundMethod or field that the type is associated with a, JavaType Type derived from the setter argument type)Method called to see if given method has annotations that indicate a more specific type than what the argument specifies. |
pack-priv Object |
_cachedDeserializers | back to summary |
---|---|
protected final LookupCache<JavaType, JsonDeserializer<Object>> _cachedDeserializers We will also cache some dynamically constructed deserializers; specifically, ones that are expensive to construct. This currently means POJO, Enum and Container deserializers. |
_incompleteDeserializers | back to summary |
---|---|
protected final HashMap<JavaType, JsonDeserializer<Object>> _incompleteDeserializers During deserializer construction process we may need to keep track of partially completed deserializers, to resolve cyclic dependencies. This is the map used for storing deserializers before they are fully complete. |
_incompleteDeserializersLock | back to summary |
---|---|
private final ReentrantLock _incompleteDeserializersLock We hold an explicit lock while creating deserializers to avoid creating duplicates.
Guards
|
DEFAULT_MAX_CACHE_SIZE | back to summary |
---|---|
public static final int DEFAULT_MAX_CACHE_SIZE Default size of the underlying cache to use.
|
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
DeserializerCache | back to summary |
---|---|
public DeserializerCache() |
DeserializerCache | back to summary |
---|---|
public DeserializerCache(int maxSize) |
DeserializerCache | back to summary |
---|---|
public DeserializerCache(LookupCache<JavaType, JsonDeserializer<Object>> cache)
|
_createAndCache2 | back to summary |
---|---|
protected JsonDeserializer Deprecated Since 2.18 use version of _createAndCache2 that takes `isCustom` flag Method that handles actual construction (via factory) and caching (both intermediate and eventual)
|
_createAndCache2 | back to summary |
---|---|
protected JsonDeserializer |
_createAndCacheValueDeserializer | back to summary |
---|---|
protected JsonDeserializer Method that will try to create a deserializer for given type, and resolve and cache it if necessary
|
_createDeserializer | back to summary |
---|---|
protected JsonDeserializer Method that does the heavy lifting of checking for per-type annotations, find out full type, and figure out which actual factory method to call.
|
_createDeserializer2 | back to summary |
---|---|
protected JsonDeserializer |
_findCachedDeserializer | back to summary |
---|---|
protected JsonDeserializer |
_handleUnknownKeyDeserializer | back to summary |
---|---|
protected KeyDeserializer _handleUnknownKeyDeserializer(DeserializationContext ctxt, JavaType type) throws JsonMappingException |
_handleUnknownValueDeserializer | back to summary |
---|---|
protected JsonDeserializer |
_hasCustomHandlers | back to summary |
---|---|
private boolean _hasCustomHandlers(JavaType t) Helper method used to prevent both caching and cache lookups for structured types that have custom value handlers
|
_verifyAsClass | back to summary |
---|---|
private Class |
cachedDeserializersCount | back to summary |
---|---|
public int cachedDeserializersCount() Method that can be used to determine how many deserializers this provider is caching currently (if it does caching: default implementation does) Exact count depends on what kind of deserializers get cached; default implementation caches only dynamically constructed deserializers, but not eagerly constructed standard deserializers (which is different from how serializer provider works). The main use case for this method is to allow conditional flushing of deserializer cache, if certain number of entries is reached. |
emptyCopy | back to summary |
---|---|
public DeserializerCache emptyCopy()
|
findConverter | back to summary |
---|---|
protected Converter |
findConvertingDeserializer | back to summary |
---|---|
protected JsonDeserializer Helper method that will check whether given annotated entity (usually class,
but may also be a property accessor) indicates that a |
findDeserializerFromAnnotation | back to summary |
---|---|
protected JsonDeserializer Helper method called to check if a class or method has annotation that tells which class to use for deserialization. Returns null if no such annotation found. |
findKeyDeserializer | back to summary |
---|---|
public KeyDeserializer findKeyDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType type) throws JsonMappingException Method called to get hold of a deserializer to use for deserializing
keys for
|
findValueDeserializer | back to summary |
---|---|
public JsonDeserializer Method called to get hold of a deserializer for a value of given type; or if no such deserializer can be found, a default handler (which may do a best-effort generic serialization or just simply throw an exception when invoked). Note this method is only called for value types; not for keys.
Key deserializers can be accessed using
Note also that deserializer returned is guaranteed to be resolved
(if it is of type
|
flushCachedDeserializers | back to summary |
---|---|
public void flushCachedDeserializers() Method that will drop all dynamically constructed deserializers (ones that
are counted as result value for |
hasValueDeserializerFor | back to summary |
---|---|
public boolean hasValueDeserializerFor(DeserializationContext ctxt, DeserializerFactory factory, JavaType type) throws JsonMappingException Method called to find out whether provider would be able to find a deserializer for given type, using a root reference (i.e. not through fields or membership in an array or collection) |
modifyTypeByAnnotation | back to summary |
---|---|
private JavaType modifyTypeByAnnotation(DeserializationContext ctxt, Annotated a, JavaType type) throws JsonMappingException Method called to see if given method has annotations that indicate a more specific type than what the argument specifies. If annotations are present, they must specify compatible Class; instance of which can be assigned using the method. This means that the Class has to be raw class of type, or its sub-class (or, implementing class if original Class instance is an interface).
|
writeReplace | back to summary |
---|---|
pack-priv Object writeReplace() |