Class AbstractContextualPojoDeserializer<POJO extends DbPojo,​DAO extends Dao<POJO>>

java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<T>
tenapull.data.deserialize.AbstractContextualDeserializer<POJO>
tenapull.data.deserialize.AbstractContextualPojoDeserializer<POJO,​DAO>
Type Parameters:
POJO - the type parameter
DAO - the type parameter
All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.ContextualDeserializer, com.fasterxml.jackson.databind.deser.NullValueProvider
Direct Known Subclasses:
Lookup.Deserializer

public abstract class AbstractContextualPojoDeserializer<POJO extends DbPojo,​DAO extends Dao<POJO>>
extends AbstractContextualDeserializer<POJO>
Further implementation of AbstractContextualDeserializer that is specific to POJOs, and which also obtains the appropriate Dao for the pojo type provided
  • Nested Class Summary

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

    com.fasterxml.jackson.databind.JsonDeserializer.None
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected DAO dao
    The Dao for the target pojo type
    protected java.lang.Class<POJO> pojoType
    The Pojo type.
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractContextualPojoDeserializer()  
  • Method Summary

    Modifier and Type Method Description
    com.fasterxml.jackson.databind.JsonDeserializer<POJO> createContextual​(com.fasterxml.jackson.databind.DeserializationContext deserializationContext, com.fasterxml.jackson.databind.BeanProperty beanProperty)
    First invokes super.createContextual, which obtains the target deserialization type.
    void setType​(java.lang.Class<POJO> pojoType)
    First invokes the super's setType, then also sets its own pojoType and finds the appropriate Dao for the type

    Methods inherited from class tenapull.data.deserialize.AbstractContextualDeserializer

    getJavaType, getLogger, getType

    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
  • Field Details

    • pojoType

      protected java.lang.Class<POJO extends DbPojo> pojoType
      The Pojo type. This mirrors the type property in the parent superclass AbstractContextualDeserializer, but is protected instead of private so that subclass implementations may access it directly.
    • dao

      protected DAO extends Dao<POJO> dao
      The Dao for the target pojo type
  • Constructor Details

  • Method Details

    • setType

      public void setType​(java.lang.Class<POJO> pojoType)
      First invokes the super's setType, then also sets its own pojoType and finds the appropriate Dao for the type
      Overrides:
      setType in class AbstractContextualDeserializer<POJO extends DbPojo>
      Parameters:
      pojoType -
    • createContextual

      public com.fasterxml.jackson.databind.JsonDeserializer<POJO> createContextual​(com.fasterxml.jackson.databind.DeserializationContext deserializationContext, com.fasterxml.jackson.databind.BeanProperty beanProperty) throws com.fasterxml.jackson.databind.JsonMappingException
      First invokes super.createContextual, which obtains the target deserialization type. Then obtains the type's Dao through calling the fetchDao() method
      Specified by:
      createContextual in interface com.fasterxml.jackson.databind.deser.ContextualDeserializer
      Overrides:
      createContextual in class AbstractContextualDeserializer<POJO extends DbPojo>
      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