Package tenapull.data.deserialize
Class AbstractContextualDeserializer<T>
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<T>
tenapull.data.deserialize.AbstractContextualDeserializer<T>
- Type Parameters:
T
- the type parameter
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.ContextualDeserializer
,com.fasterxml.jackson.databind.deser.NullValueProvider
- Direct Known Subclasses:
AbstractContextualPojoDeserializer
public abstract class AbstractContextualDeserializer<T>
extends com.fasterxml.jackson.databind.JsonDeserializer<T>
implements com.fasterxml.jackson.databind.deser.ContextualDeserializer
Implementation of Jackson's JsonDeserializer and ContextualDeserializer which
obtains the intended target type of the data to be deserialized through Jackson's
ContextualDeserializer.createContextual method. Stores the result in the type property
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description AbstractContextualDeserializer()
-
Method Summary
Modifier and Type Method Description com.fasterxml.jackson.databind.JsonDeserializer<T>
createContextual(com.fasterxml.jackson.databind.DeserializationContext deserializationContext, com.fasterxml.jackson.databind.BeanProperty beanProperty)
Obtains the intended target type for deserialization, via Jackson's JavaType See also: https://stackoverflow.com/questions/47348029/get-the-detected-generic-type-inside-jacksons-jsondeserializercom.fasterxml.jackson.databind.JavaType
getJavaType()
Gets the JavaType provided by Jackson in the createContextual methodprotected abstract org.apache.logging.log4j.Logger
getLogger()
Gets the logger for the implemented deserializer classjava.lang.Class<T>
getType()
Gets the target deserialization typevoid
setType(java.lang.Class<T> type)
Sets the target deserialization typeMethods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserialize, deserializeWithType, deserializeWithType, findBackReference, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
AbstractContextualDeserializer
public AbstractContextualDeserializer()
-
-
Method Details
-
getLogger
protected abstract org.apache.logging.log4j.Logger getLogger()Gets the logger for the implemented deserializer class- Returns:
- the logger
-
getType
Gets the target deserialization type- Returns:
- the type
-
setType
Sets the target deserialization type- Parameters:
type
- the type
-
getJavaType
public com.fasterxml.jackson.databind.JavaType getJavaType()Gets the JavaType provided by Jackson in the createContextual method- Returns:
- the java type
-
createContextual
public com.fasterxml.jackson.databind.JsonDeserializer<T> createContextual(com.fasterxml.jackson.databind.DeserializationContext deserializationContext, com.fasterxml.jackson.databind.BeanProperty beanProperty) throws com.fasterxml.jackson.databind.JsonMappingExceptionObtains the intended target type for deserialization, via Jackson's JavaType See also: https://stackoverflow.com/questions/47348029/get-the-detected-generic-type-inside-jacksons-jsondeserializer- Specified by:
createContextual
in interfacecom.fasterxml.jackson.databind.deser.ContextualDeserializer
- Parameters:
deserializationContext
-beanProperty
-- Returns:
- this, since it serves a dual-purpose as both the contextual parser and the deserializer
- Throws:
com.fasterxml.jackson.databind.JsonMappingException
-