Top Description Fields Constructors Methods
tools.jackson.dataformat.ion.polymorphism

public Class IonAnnotationIntrospector

extends NopAnnotationIntrospector
Class Inheritance
Imports
tools.jackson.databind.JavaType, tools.jackson.databind.annotation.JsonTypeResolver, tools.jackson.databind.cfg.MapperConfig, tools.jackson.databind.introspect.Annotated, .NopAnnotationIntrospector, tools.jackson.databind.jsontype.PolymorphicTypeValidator, .TypeIdResolver

A Jackson tools.jackson.databind.AnnotationIntrospector (essentially an interceptor for serializer/deserializer construction) that provides type serializer/deserializers that write/read Ion type annotations.

The logic in this class is very similar to tools.jackson.databind.introspect.JacksonAnnotationIntrospector! We both look at the @JsonTypeResolver, etc annotations and try to make type resolvers.

This class adds a resolveAllTypes override, which allows for universal polymorphism without needing any annotations or mixins, and also permits top-level polymorphism -- deserialize to any object without providing its actual type, as long as type information was serialized. (i.e., ObjectMapper#readValue(serializedData, Object.class))

Note

the provided tools.jackson.databind.jsontype.TypeSerializer will only write type annotations if the configured TypeIdResolver returns non-null.

Note

tools.jackson.databind.jsontype.TypeDeserializer are actually full-on value deserializers -- all deserialization logic goes through them (unlike TypeSerializers, which just write the type metadata).

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from tools.jackson.databind.introspect.NopAnnotationIntrospector:
instance

Constructor Summary

AccessConstructor and Description
public
IonAnnotationIntrospector(boolean resolveAllTypes)

Method Summary

Modifier and TypeMethod and Description
protected TypeIdResolver
protected boolean
Inherited from tools.jackson.databind.introspect.NopAnnotationIntrospector:
version

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.introspect.NopAnnotationIntrospector.serialVersionUID.

Constructor Detail

IonAnnotationIntrospectorback to summary
public IonAnnotationIntrospector(boolean resolveAllTypes)

Method Detail

defaultIdResolverback to summary
protected TypeIdResolver defaultIdResolver(MapperConfig<?> config, JavaType baseType, PolymorphicTypeValidator ptv)
shouldResolveTypeback to summary
protected boolean shouldResolveType(Annotated ac)