Top Description Fields Constructors Methods
com.fasterxml.jackson.dataformat.ion.polymorphism

public Class IonAnnotationTypeDeserializer

extends TypeDeserializerBase
Class Inheritance
Imports
java.io.IOException, com.fasterxml.jackson.annotation.JsonTypeInfo, com.fasterxml.jackson.core.JsonParseException, .JsonParser, .JsonProcessingException, com.fasterxml.jackson.databind.BeanProperty, .DeserializationContext, .JavaType, .JsonDeserializer, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, .TypeIdResolver, com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase, com.fasterxml.jackson.dataformat.ion.IonParser

This is a com.fasterxml.jackson.databind.jsontype.TypeDeserializer that reads typing metadata from Ion type annotations. Annotations found are processed by the configured TypeIdResolver to provide a concrete Java class, which is in turn used to find the appropriate JsonDeserializer, and execute it.

If multiple annotations are found, the first annotation to resolve to a non-null JavaType using the configured TypeIdResolver is used. Ion provides type annotations in alphabetic order.

See Also
MultipleTypeIdResolver

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase:
_baseType_defaultImpl_defaultImplDeserializer_deserializers_idResolver_property_typeIdVisible_typePropertyName

Constructor Summary

AccessConstructor and Description
public
IonAnnotationTypeDeserializer(JavaType baseType, TypeIdResolver idRes, String typePropertyName, boolean typeIdVisible, JavaType defaultImpl)

Method Summary

Modifier and TypeMethod and Description
private Object
public Object
deserializeTypedFromAny(JsonParser p, DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromAny.

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).

public Object
deserializeTypedFromArray(JsonParser p, DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromArray.

Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as JSON Array (regardless of Java type).

public Object
deserializeTypedFromObject(JsonParser p, DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromObject.

Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as JSON Object (regardless of Java type).

public Object
deserializeTypedFromScalar(JsonParser p, DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromScalar.

Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as a scalar JSON value (something other than Array or Object), regardless of Java type.

public TypeDeserializer
forProperty(BeanProperty prop)

Implements abstract com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase.forProperty.

Method called to create contextual version, to be used for values of given property.

public JsonTypeInfo.As

Returns:

null
getTypeInclusion
()

Implements abstract com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase.getTypeInclusion.

Used for informational purposes and some serialization-implementation-specific logics (which do not concern us).

private IonParser
Inherited from com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase:
_deserializeWithNativeTypeId_deserializeWithNativeTypeId_findDefaultImplDeserializer_findDeserializer_handleMissingTypeId_handleUnknownTypeIdbaseTypebaseTypeNamegetDefaultImplgetPropertyNamegetTypeIdResolverhasDefaultImpltoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase.serialVersionUID.

Constructor Detail

IonAnnotationTypeDeserializerback to summary
public IonAnnotationTypeDeserializer(JavaType baseType, TypeIdResolver idRes, String typePropertyName, boolean typeIdVisible, JavaType defaultImpl)

Method Detail

_deserializeback to summary
private Object _deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException
deserializeTypedFromAnyback to summary
public Object deserializeTypedFromAny(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromAny.

Doc from com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromAny.

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). 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).

Annotations
@Override
deserializeTypedFromArrayback to summary
public Object deserializeTypedFromArray(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromArray.

Doc from com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromArray.

Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as JSON Array (regardless of Java type). Method needs to figure out intended polymorphic type, locate JsonDeserializer to use, and call it with JSON data to deserializer (which does not contain type information).

Annotations
@Override
deserializeTypedFromObjectback to summary
public Object deserializeTypedFromObject(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromObject.

Doc from com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromObject.

Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as JSON Object (regardless of Java type). Method needs to figure out intended polymorphic type, locate JsonDeserializer to use, and call it with JSON data to deserializer (which does not contain type information).

Annotations
@Override
deserializeTypedFromScalarback to summary
public Object deserializeTypedFromScalar(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromScalar.

Doc from com.fasterxml.jackson.databind.jsontype.TypeDeserializer.deserializeTypedFromScalar.

Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as a scalar JSON value (something other than Array or Object), regardless of Java type. Method needs to figure out intended polymorphic type, locate JsonDeserializer to use, and call it with JSON data to deserializer (which does not contain type information).

Annotations
@Override
forPropertyback to summary
public TypeDeserializer forProperty(BeanProperty prop)

Implements abstract com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase.forProperty.

Doc from com.fasterxml.jackson.databind.jsontype.TypeDeserializer.forProperty.

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 java.util.Collection or java.util.Map valued properties).

Annotations
@Override
getTypeInclusionback to summary
public JsonTypeInfo.As getTypeInclusion()

Implements abstract com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase.getTypeInclusion.

Used for informational purposes and some serialization-implementation-specific logics (which do not concern us). We have to return an enum which we cannot extend, and none of them accurately reflect what we do.

Returns:JsonTypeInfo.As

null

Annotations
@Override
ionParserback to summary
private IonParser ionParser(JsonParser p) throws JsonParseException