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

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer

    com.fasterxml.jackson.databind.JsonDeserializer.None
  • 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-jsondeserializer
    com.fasterxml.jackson.databind.JavaType getJavaType()
    Gets the JavaType provided by Jackson in the createContextual method
    protected abstract org.apache.logging.log4j.Logger getLogger()
    Gets the logger for the implemented deserializer class
    java.lang.Class<T> getType()
    Gets the target deserialization type
    void setType​(java.lang.Class<T> type)
    Sets the target deserialization type

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getLogger

      protected abstract org.apache.logging.log4j.Logger getLogger()
      Gets the logger for the implemented deserializer class
      Returns:
      the logger
    • getType

      public java.lang.Class<T> getType()
      Gets the target deserialization type
      Returns:
      the type
    • setType

      public void setType​(java.lang.Class<T> type)
      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.JsonMappingException
      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-jsondeserializer
      Specified by:
      createContextual in interface com.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