Module tools.jackson.databind
Class AsDeductionTypeDeserializer
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
tools.jackson.databind.jsontype.impl.AsDeductionTypeDeserializer
A
TypeDeserializer capable of deducing polymorphic types based on the
fields available. Deduction is limited to the names of child properties
(not their values or, consequently, any nested descendants).
Exceptions will be thrown if not enough unique information is present
to select a single subtype.
The current deduction process does not support pojo-hierarchies such that the absence of child fields infers a parent type. That is, every deducible subtype MUST have some unique fields and the input data MUST contain said unique fields to provide a positive match.
-
Field Summary
Fields inherited from class tools.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer
_inclusion, _msgForMissingId, _strictTypeIdHandlingFields inherited from class tools.jackson.databind.jsontype.impl.TypeDeserializerBase
_baseType, _defaultImpl, _defaultImplDeserializer, _deserializers, _idResolver, _property, _typeIdVisible, _typePropertyName -
Constructor Summary
ConstructorsConstructorDescriptionAsDeductionTypeDeserializer(DeserializationContext ctxt, JavaType bt, TypeIdResolver idRes, JavaType defaultImpl, Collection<NamedType> subtypes) AsDeductionTypeDeserializer(AsDeductionTypeDeserializer src, BeanProperty property) -
Method Summary
Modifier and TypeMethodDescriptionbuildFingerprints(DeserializationContext ctxt, Collection<NamedType> subtypes) 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.Methods inherited from class tools.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer
_deserializeTypedForId, _deserializeTypedUsingDefaultImpl, deserializeTypedFromAny, getTypeInclusionMethods 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
-
Constructor Details
-
AsDeductionTypeDeserializer
public AsDeductionTypeDeserializer(DeserializationContext ctxt, JavaType bt, TypeIdResolver idRes, JavaType defaultImpl, Collection<NamedType> subtypes) -
AsDeductionTypeDeserializer
-
-
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 classAsPropertyTypeDeserializer
-
buildFingerprints
protected Map<BitSet,String> buildFingerprints(DeserializationContext ctxt, Collection<NamedType> subtypes) -
deserializeTypedFromObject
public Object deserializeTypedFromObject(JsonParser p, DeserializationContext ctxt) throws JacksonException Description copied from class:AsPropertyTypeDeserializerThis is the trickiest thing to handle, since property we are looking for may be anywhere...- Overrides:
deserializeTypedFromObjectin classAsPropertyTypeDeserializer- Throws:
JacksonException
-