public abstract class TypeDeserializerBase extends TypeDeserializer implements java.io.Serializable
TypeDeserializer
s.Modifier and Type | Field and Description |
---|---|
protected JavaType |
_baseType |
protected JavaType |
_defaultImpl
Type to use as the default implementation, if type id is
missing or can not be resolved.
|
protected JsonDeserializer<java.lang.Object> |
_defaultImplDeserializer |
protected 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.
|
protected TypeIdResolver |
_idResolver |
protected BeanProperty |
_property
Property that contains value for which type information
is included; null if value is a root value.
|
protected boolean |
_typeIdVisible |
protected 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.
|
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
protected |
TypeDeserializerBase(JavaType baseType,
TypeIdResolver idRes,
java.lang.String typePropertyName,
boolean typeIdVisible,
java.lang.Class<?> defaultImpl) |
protected |
TypeDeserializerBase(TypeDeserializerBase src,
BeanProperty property) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
_deserializeWithNativeTypeId(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt)
Deprecated.
|
protected java.lang.Object |
_deserializeWithNativeTypeId(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt,
java.lang.Object typeId)
Helper method called when
JsonParser indicates that it can use
so-called native type ids, and such type id has been found. |
protected JsonDeserializer<java.lang.Object> |
_findDefaultImplDeserializer(DeserializationContext ctxt) |
protected JsonDeserializer<java.lang.Object> |
_findDeserializer(DeserializationContext ctxt,
java.lang.String typeId) |
protected JsonDeserializer<java.lang.Object> |
_handleUnknownTypeId(DeserializationContext ctxt,
java.lang.String typeId,
TypeIdResolver idResolver,
JavaType baseType)
Helper method called when given type id can not be resolved into
concrete deserializer either directly (using given
TypeIdResolver ),
or using default type. |
java.lang.String |
baseTypeName() |
abstract TypeDeserializer |
forProperty(BeanProperty prop)
Method called to create contextual version, to be used for
values of given property.
|
java.lang.Class<?> |
getDefaultImpl()
Accessor for "default implementation" type; optionally defined
class to use in cases where type id is not
accessible for some reason (either missing, or can not be
resolved)
|
java.lang.String |
getPropertyName()
Name of property that contains type information, if
property-based inclusion is used.
|
TypeIdResolver |
getTypeIdResolver()
Accessor for object that handles conversions between
types and matching type ids.
|
abstract com.fasterxml.jackson.annotation.JsonTypeInfo.As |
getTypeInclusion()
Accessor for type information inclusion method
that deserializer uses; indicates how type information
is (expected to be) embedded in JSON input.
|
java.lang.String |
toString() |
deserializeIfNatural, deserializeIfNatural, deserializeTypedFromAny, deserializeTypedFromArray, deserializeTypedFromObject, deserializeTypedFromScalar
private static final long serialVersionUID
protected final TypeIdResolver _idResolver
protected final JavaType _baseType
protected final BeanProperty _property
forProperty(com.fasterxml.jackson.databind.BeanProperty)
is called to create
a copy.protected final JavaType _defaultImpl
protected final java.lang.String _typePropertyName
protected final boolean _typeIdVisible
protected final java.util.Map<java.lang.String,JsonDeserializer<java.lang.Object>> _deserializers
protected JsonDeserializer<java.lang.Object> _defaultImplDeserializer
protected TypeDeserializerBase(JavaType baseType, TypeIdResolver idRes, java.lang.String typePropertyName, boolean typeIdVisible, java.lang.Class<?> defaultImpl)
protected TypeDeserializerBase(TypeDeserializerBase src, BeanProperty property)
public abstract TypeDeserializer forProperty(BeanProperty prop)
TypeDeserializer
Collection
or Map
valued properties).forProperty
in class TypeDeserializer
public abstract com.fasterxml.jackson.annotation.JsonTypeInfo.As getTypeInclusion()
TypeDeserializer
getTypeInclusion
in class TypeDeserializer
public java.lang.String baseTypeName()
public final java.lang.String getPropertyName()
TypeDeserializer
getPropertyName
in class TypeDeserializer
public TypeIdResolver getTypeIdResolver()
TypeDeserializer
getTypeIdResolver
in class TypeDeserializer
public java.lang.Class<?> getDefaultImpl()
TypeDeserializer
getDefaultImpl
in class TypeDeserializer
public java.lang.String toString()
toString
in class java.lang.Object
protected final JsonDeserializer<java.lang.Object> _findDeserializer(DeserializationContext ctxt, java.lang.String typeId) throws java.io.IOException
java.io.IOException
protected final JsonDeserializer<java.lang.Object> _findDefaultImplDeserializer(DeserializationContext ctxt) throws java.io.IOException
java.io.IOException
@Deprecated protected java.lang.Object _deserializeWithNativeTypeId(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt) throws java.io.IOException
JsonParser
indicates that it can use
so-called native type ids. Assumption from there is that only native
type ids are to be used.java.io.IOException
protected java.lang.Object _deserializeWithNativeTypeId(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt, java.lang.Object typeId) throws java.io.IOException
JsonParser
indicates that it can use
so-called native type ids, and such type id has been found.java.io.IOException
protected JsonDeserializer<java.lang.Object> _handleUnknownTypeId(DeserializationContext ctxt, java.lang.String typeId, TypeIdResolver idResolver, JavaType baseType) throws java.io.IOException
TypeIdResolver
),
or using default type.
Default implementation simply throws a JsonMappingException
to
indicate the problem; sub-classes may chooseJsonDeserializer
should return that deserializer; otherwise throw an exception to indicate
the problem.java.io.IOException