Module tools.jackson.databind
Class AsPropertyTypeDeserializer
java.lang.Object
tools.jackson.databind.jsontype.TypeDeserializer
tools.jackson.databind.jsontype.impl.TypeDeserializerBase
tools.jackson.databind.jsontype.impl.AsArrayTypeDeserializer
tools.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer
- Direct Known Subclasses:
AsDeductionTypeDeserializer
Type deserializer used with
JsonTypeInfo.As.PROPERTY
inclusion mechanism.
Uses regular form (additional key/value entry before actual data)
when typed object is expressed as JSON Object; otherwise behaves similar to how
JsonTypeInfo.As.WRAPPER_ARRAY works.
Latter is used if JSON representation is polymorphic-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JsonTypeInfo.Asprotected final Stringprotected final booleanIndicates that we should be strict about handling missing type information.Fields inherited from class tools.jackson.databind.jsontype.impl.TypeDeserializerBase
_baseType, _defaultImpl, _defaultImplDeserializer, _deserializers, _idResolver, _property, _typeIdVisible, _typePropertyName -
Constructor Summary
ConstructorsConstructorDescriptionAsPropertyTypeDeserializer(JavaType bt, TypeIdResolver idRes, String typePropertyName, boolean typeIdVisible, JavaType defaultImpl, JsonTypeInfo.As inclusion, boolean strictTypeIdHandling) AsPropertyTypeDeserializer(AsPropertyTypeDeserializer src, BeanProperty property) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object_deserializeTypedForId(JsonParser p, DeserializationContext ctxt, TokenBuffer tb, String typeId) protected Object_deserializeTypedUsingDefaultImpl(JsonParser p, DeserializationContext ctxt, TokenBuffer tb, String priorFailureMsg) Method called to let this type deserializer handle deserialization of "typed" object, when value itself may have been serialized using any kind of JSON value (Array, Object, scalar).This is the trickiest thing to handle, since property we are looking for may be anywhere...forProperty(BeanProperty prop) Method called to create contextual version, to be used for values of given property.Accessor for type information inclusion method that deserializer uses; indicates how type information is (expected to be) embedded in JSON input.Methods inherited from class tools.jackson.databind.jsontype.impl.AsArrayTypeDeserializer
_deserialize, _locateTypeId, _usesExternalId, deserializeTypedFromArray, deserializeTypedFromScalarMethods inherited from class tools.jackson.databind.jsontype.impl.TypeDeserializerBase
_deserializeWithNativeTypeId, _findDefaultImplDeserializer, _findDeserializer, _handleMissingTypeId, _handleUnknownTypeId, baseType, baseTypeName, getDefaultImpl, getPropertyName, getTypeIdResolver, hasDefaultImpl, toStringMethods inherited from class tools.jackson.databind.jsontype.TypeDeserializer
deserializeIfNatural, deserializeIfNatural
-
Field Details
-
_inclusion
-
_strictTypeIdHandling
protected final boolean _strictTypeIdHandlingIndicates that we should be strict about handling missing type information.- Since:
- 2.15
-
_msgForMissingId
-
-
Constructor Details
-
AsPropertyTypeDeserializer
public AsPropertyTypeDeserializer(JavaType bt, TypeIdResolver idRes, String typePropertyName, boolean typeIdVisible, JavaType defaultImpl, JsonTypeInfo.As inclusion, boolean strictTypeIdHandling) -
AsPropertyTypeDeserializer
-
-
Method Details
-
forProperty
Description copied from class:TypeDeserializerMethod 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 (forCollectionorMapvalued properties).- Overrides:
forPropertyin classAsArrayTypeDeserializer
-
getTypeInclusion
Description copied from class:TypeDeserializerAccessor for type information inclusion method that deserializer uses; indicates how type information is (expected to be) embedded in JSON input.- Overrides:
getTypeInclusionin classAsArrayTypeDeserializer
-
deserializeTypedFromObject
public Object deserializeTypedFromObject(JsonParser p, DeserializationContext ctxt) throws JacksonException This is the trickiest thing to handle, since property we are looking for may be anywhere...- Overrides:
deserializeTypedFromObjectin classAsArrayTypeDeserializer- Throws:
JacksonException
-
_deserializeTypedForId
protected Object _deserializeTypedForId(JsonParser p, DeserializationContext ctxt, TokenBuffer tb, String typeId) throws JacksonException - Throws:
JacksonException
-
_deserializeTypedUsingDefaultImpl
protected Object _deserializeTypedUsingDefaultImpl(JsonParser p, DeserializationContext ctxt, TokenBuffer tb, String priorFailureMsg) throws JacksonException - Throws:
JacksonException
-
deserializeTypedFromAny
public Object deserializeTypedFromAny(JsonParser p, DeserializationContext ctxt) throws JacksonException Description copied from class:TypeDeserializerMethod called to let this type deserializer handle deserialization of "typed" object, when value itself may have been serialized using any kind of JSON value (Array, Object, scalar). Should only be called if JSON serialization is polymorphic (not Java type); for example when using JSON node representation, or "untyped" Java object (which may be Map, Collection, wrapper/primitive etc).- Overrides:
deserializeTypedFromAnyin classAsArrayTypeDeserializer- Throws:
JacksonException
-