- All Implemented Interfaces:
Serializable
ObjectMapper,
DeserializationContext)
and classes that construct deserializers
(DeserializerFactory).- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault size of the underlying cache to use. -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected ValueDeserializer<Object>_createAndCache2(DeserializationContext ctxt, DeserializerFactory factory, JavaType type, boolean isCustom) Method that handles actual construction (via factory) and caching (both intermediate and eventual)protected ValueDeserializer<Object>_createAndCacheValueDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType type) Method that will try to create a deserializer for given type, and resolve and cache it if necessaryprotected ValueDeserializer<Object>_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 ValueDeserializer<?>_createDeserializer2(DeserializationContext ctxt, DeserializerFactory factory, JavaType type, BeanDescription.Supplier beanDescRef) protected ValueDeserializer<Object>protected KeyDeserializerprotected ValueDeserializer<Object>intMethod 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).findConverter(DeserializationContext ctxt, Annotated a) protected ValueDeserializer<Object>findConvertingDeserializer(DeserializationContext ctxt, Annotated a, ValueDeserializer<Object> deser) Helper method that will check whether given annotated entity (usually class, but may also be a property accessor) indicates that aConverteris to be used; and if so, to construct and return suitable serializer for it.protected ValueDeserializer<Object>Helper method called to check if a class or method has annotation that tells which class to use for deserialization.findKeyDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType type) Method called to get hold of a deserializer to use for deserializing keys forMap.findValueDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType 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).voidMethod that will drop all dynamically constructed deserializers (ones that are counted as result value forcachedDeserializersCount()).protected Object
-
Field Details
-
DEFAULT_MAX_CACHE_SIZE
public static final int DEFAULT_MAX_CACHE_SIZEDefault size of the underlying cache to use.NOTE: reduced from 2.x default.
- See Also:
-
-
Constructor Details
-
DeserializerCache
public DeserializerCache() -
DeserializerCache
-
-
Method Details
-
emptyCopy
-
readResolve
-
cachedDeserializersCount
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.
-
flushCachedDeserializers
public void flushCachedDeserializers()Method that will drop all dynamically constructed deserializers (ones that are counted as result value forcachedDeserializersCount()). This can be used to remove memory usage (in case some deserializers are only used once or so), or to force re-construction of deserializers after configuration changes for mapper than owns the provider. -
findValueDeserializer
public ValueDeserializer<Object> findValueDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType 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).Note: this method is only called for value types; not for keys. Key deserializers can be accessed using
findKeyDeserializer(tools.jackson.databind.DeserializationContext, tools.jackson.databind.deser.DeserializerFactory, tools.jackson.databind.JavaType).Note also that deserializer returned is guaranteed to be resolved (see
ValueDeserializer.resolve(tools.jackson.databind.DeserializationContext)), but not contextualized (wrtValueDeserializer.createContextual(tools.jackson.databind.DeserializationContext, tools.jackson.databind.BeanProperty)): caller has to handle latter if necessary.- Parameters:
ctxt- Deserialization contextpropertyType- Declared type of the value to deserializer (obtained using 'setter' method signature and/or type annotations
-
findKeyDeserializer
public KeyDeserializer findKeyDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType type) Method called to get hold of a deserializer to use for deserializing keys forMap.- Throws:
DatabindException- if there are fatal problems with accessing suitable key deserializer; including that of not finding any serializer
-
_findCachedDeserializer
-
_createAndCacheValueDeserializer
protected ValueDeserializer<Object> _createAndCacheValueDeserializer(DeserializationContext ctxt, DeserializerFactory factory, JavaType type) Method that will try to create a deserializer for given type, and resolve and cache it if necessary- Parameters:
ctxt- Currently active deserialization contexttype- Type of property to deserialize (never null, callers verify)
-
_createAndCache2
protected ValueDeserializer<Object> _createAndCache2(DeserializationContext ctxt, DeserializerFactory factory, JavaType type, boolean isCustom) Method that handles actual construction (via factory) and caching (both intermediate and eventual) -
_createDeserializer
protected ValueDeserializer<Object> _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. -
_createDeserializer2
protected ValueDeserializer<?> _createDeserializer2(DeserializationContext ctxt, DeserializerFactory factory, JavaType type, BeanDescription.Supplier beanDescRef) -
findDeserializerFromAnnotation
protected ValueDeserializer<Object> 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. Returns null if no such annotation found. -
findConvertingDeserializer
protected ValueDeserializer<Object> findConvertingDeserializer(DeserializationContext ctxt, Annotated a, ValueDeserializer<Object> deser) Helper method that will check whether given annotated entity (usually class, but may also be a property accessor) indicates that aConverteris to be used; and if so, to construct and return suitable serializer for it. If not, will simply return given serializer as is. -
findConverter
-
_handleUnknownValueDeserializer
protected ValueDeserializer<Object> _handleUnknownValueDeserializer(DeserializationContext ctxt, JavaType type) -
_handleUnknownKeyDeserializer
-