Class JsonUnwrappedDeserializer<T>

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.deser.ContextualDeserializer, com.fasterxml.jackson.databind.deser.NullValueProvider

    public class JsonUnwrappedDeserializer<T>
    extends com.fasterxml.jackson.databind.JsonDeserializer<T>
    implements com.fasterxml.jackson.databind.deser.ContextualDeserializer
    Desc: this is a workaround on the problem that Jackson's @JsonUnwrapped doesn't work with polymorphism (@JsonTypeInfo) Adapted from https://stackoverflow.com/questions/37423848/deserializing-polymorphic-types-with-jsonunwrapped-using-jackson
    • Nested Class Summary

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.fasterxml.jackson.databind.JsonDeserializer<?> createContextual​(com.fasterxml.jackson.databind.DeserializationContext deserializationContext, com.fasterxml.jackson.databind.BeanProperty beanProperty)  
      T deserialize​(com.fasterxml.jackson.core.JsonParser jsonParser, com.fasterxml.jackson.databind.DeserializationContext deserializationContext)  
      • Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer

        deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
    • Constructor Detail

      • JsonUnwrappedDeserializer

        public JsonUnwrappedDeserializer()
      • JsonUnwrappedDeserializer

        public JsonUnwrappedDeserializer​(com.fasterxml.jackson.databind.DeserializationContext deserializationContext)
                                  throws com.fasterxml.jackson.databind.JsonMappingException
        Throws:
        com.fasterxml.jackson.databind.JsonMappingException
    • Method Detail

      • createContextual

        public com.fasterxml.jackson.databind.JsonDeserializer<?> createContextual​(com.fasterxml.jackson.databind.DeserializationContext deserializationContext,
                                                                                   com.fasterxml.jackson.databind.BeanProperty beanProperty)
                                                                            throws com.fasterxml.jackson.databind.JsonMappingException
        Specified by:
        createContextual in interface com.fasterxml.jackson.databind.deser.ContextualDeserializer
        Throws:
        com.fasterxml.jackson.databind.JsonMappingException
      • deserialize

        public T deserialize​(com.fasterxml.jackson.core.JsonParser jsonParser,
                             com.fasterxml.jackson.databind.DeserializationContext deserializationContext)
                      throws IOException
        Specified by:
        deserialize in class com.fasterxml.jackson.databind.JsonDeserializer<T>
        Throws:
        IOException