Class TypeDeserializerBase

    • Field Detail

      • _baseType

        protected final JavaType _baseType
      • _defaultImpl

        protected final JavaType _defaultImpl
        Type to use as the default implementation, if type id is missing or cannot be resolved.
      • _typePropertyName

        protected final java.lang.String _typePropertyName
        Name of type property used; needed for non-property versions too, in cases where type id is to be exposed as part of JSON.
      • _typeIdVisible

        protected final boolean _typeIdVisible
      • _deserializers

        protected final java.util.Map<java.lang.String,​JsonDeserializer<java.lang.Object>> _deserializers
        For efficient operation we will lazily build mappings from type ids to actual deserializers, once needed.
      • _defaultImplDeserializer

        protected JsonDeserializer<java.lang.Object> _defaultImplDeserializer
    • Method Detail

      • forProperty

        public abstract TypeDeserializer forProperty​(BeanProperty prop)
        Description copied from class: TypeDeserializer
        Method called to create contextual version, to be used for values of given property. This may be the type itself (as is the case for bean properties), or values contained (for Collection or Map valued properties).
        Specified by:
        forProperty in class TypeDeserializer
      • getTypeInclusion

        public abstract com.fasterxml.jackson.annotation.JsonTypeInfo.As getTypeInclusion()
        Description copied from class: TypeDeserializer
        Accessor for type information inclusion method that deserializer uses; indicates how type information is (expected to be) embedded in JSON input.
        Specified by:
        getTypeInclusion in class TypeDeserializer
      • baseTypeName

        public java.lang.String baseTypeName()
      • getPropertyName

        public final java.lang.String getPropertyName()
        Description copied from class: TypeDeserializer
        Name of property that contains type information, if property-based inclusion is used.
        Specified by:
        getPropertyName in class TypeDeserializer
      • getDefaultImpl

        public java.lang.Class<?> getDefaultImpl()
        Description copied from class: TypeDeserializer
        Accessor for "default implementation" type; optionally defined class to use in cases where type id is not accessible for some reason (either missing, or cannot be resolved)
        Specified by:
        getDefaultImpl in class TypeDeserializer
      • baseType

        public JavaType baseType()
        Since:
        2.9
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • _findDeserializer

        protected final JsonDeserializer<java.lang.Object> _findDeserializer​(DeserializationContext ctxt,
                                                                             java.lang.String typeId)
                                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • _findDefaultImplDeserializer

        protected final JsonDeserializer<java.lang.Object> _findDefaultImplDeserializer​(DeserializationContext ctxt)
                                                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • _deserializeWithNativeTypeId

        @Deprecated
        protected java.lang.Object _deserializeWithNativeTypeId​(com.fasterxml.jackson.core.JsonParser jp,
                                                                DeserializationContext ctxt)
                                                         throws java.io.IOException
        Deprecated.
        Helper method called when JsonParser indicates that it can use so-called native type ids. Assumption from there is that only native type ids are to be used.
        Throws:
        java.io.IOException
        Since:
        2.3
      • _deserializeWithNativeTypeId

        protected java.lang.Object _deserializeWithNativeTypeId​(com.fasterxml.jackson.core.JsonParser p,
                                                                DeserializationContext ctxt,
                                                                java.lang.Object typeId)
                                                         throws java.io.IOException
        Helper method called when JsonParser indicates that it can use so-called native type ids, and such type id has been found.
        Throws:
        java.io.IOException
        Since:
        2.4
      • _handleUnknownTypeId

        protected JavaType _handleUnknownTypeId​(DeserializationContext ctxt,
                                                java.lang.String typeId)
                                         throws java.io.IOException
        Helper method called when given type id cannot be resolved into concrete deserializer either directly (using given TypeIdResolver), or using default type. Default implementation simply throws a JsonMappingException to indicate the problem; sub-classes may choose
        Returns:
        If it is possible to resolve type id into a JsonDeserializer should return that deserializer; otherwise throw an exception to indicate the problem.
        Throws:
        java.io.IOException
        Since:
        2.8
      • _handleMissingTypeId

        protected JavaType _handleMissingTypeId​(DeserializationContext ctxt,
                                                java.lang.String extraDesc)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
        Since:
        2.9