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

public Class IonAnnotationTypeResolverBuilder

extends Object
implements TypeResolverBuilder<IonAnnotationTypeResolverBuilder>
Class Inheritance
All Implemented Interfaces
tools.jackson.databind.jsontype.TypeResolverBuilder
Imports
java.util.Collection, com.fasterxml.jackson.annotation.JsonTypeInfo, tools.jackson.databind.*, tools.jackson.databind.jsontype.*

A TypeResolverBuilder which produces TypeSerializers and TypeDeserializers that use Ion type annotations to communicate type metadata. Jackson polymorphism, the Ion way.

This TypeResolverBuilder expects to be initialized with a functional TypeIdResolver, and will serialize type information (and deserialize to something other than the default type) when it resolves the provided JavaType to a non-null type identifier, and vice versa.

Field Summary

Modifier and TypeField and Description
private Class<?>
private TypeIdResolver
private boolean
typeIdVisible

Whether type id should be exposed to deserializers or not

Constructor Summary

AccessConstructor and Description
protected
protected
protected

Method Summary

Modifier and TypeMethod and Description
public TypeDeserializer
public TypeSerializer
public static IonAnnotationTypeResolverBuilder
construct(JavaType baseType, JsonTypeInfo.Value typeInfo, TypeIdResolver idResolver)

public Class<?>
getDefaultImpl()

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.getDefaultImpl.

Accessor for currently configured default type; implementation class that may be used in case no valid type information is available during type resolution

public IonAnnotationTypeResolverBuilder
init(JsonTypeInfo.Value settings, TypeIdResolver res)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance, in cases where information could not be passed directly (for example when instantiated for an annotation)

public IonAnnotationTypeResolverBuilder
withDefaultImpl(Class<?> newDefaultImpl)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.withDefaultImpl.

"Mutant factory" method for creating a new instance with different default implementation to use if type id is either not available, or cannot be resolved.

public IonAnnotationTypeResolverBuilder
withSettings(JsonTypeInfo.Value settings)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.withSettings.

Method for overriding type information.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultImplback to summary
private Class<?> defaultImpl
typeIdResolverback to summary
private TypeIdResolver typeIdResolver
typeIdVisibleback to summary
private boolean typeIdVisible

Whether type id should be exposed to deserializers or not

Constructor Detail

IonAnnotationTypeResolverBuilderback to summary
protected IonAnnotationTypeResolverBuilder()
IonAnnotationTypeResolverBuilderback to summary
protected IonAnnotationTypeResolverBuilder(Class<?> defaultImpl, TypeIdResolver idResolver)
IonAnnotationTypeResolverBuilderback to summary
protected IonAnnotationTypeResolverBuilder(IonAnnotationTypeResolverBuilder base, Class<?> defaultImpl)

Method Detail

buildTypeDeserializerback to summary
public TypeDeserializer buildTypeDeserializer(DeserializationContext ctxt, JavaType baseType, Collection<NamedType> subtypes)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.buildTypeDeserializer.

Creates a Jackson TypeDeserializer. Unlike type serializers, deserializers are responsible for *all* steps of value deserialization: read type information, find the actual object deserializer, and run it.

Annotations
@Override
buildTypeSerializerback to summary
public TypeSerializer buildTypeSerializer(SerializationContext ctxt, JavaType baseType, Collection<NamedType> subtypes)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.buildTypeSerializer.

Creates a Jackson TypeSerializer. Note that while Jackson type serializers are responsible for writing opening and closing metadata for types *in addition* to any type information, they are not involved with writing actual object data.

Annotations
@Override
constructback to summary
public static IonAnnotationTypeResolverBuilder construct(JavaType baseType, JsonTypeInfo.Value typeInfo, TypeIdResolver idResolver)
getDefaultImplback to summary
public Class<?> getDefaultImpl()

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.getDefaultImpl.

Doc from tools.jackson.databind.jsontype.TypeResolverBuilder.getDefaultImpl.

Accessor for currently configured default type; implementation class that may be used in case no valid type information is available during type resolution

Annotations
@Override
initback to summary
public IonAnnotationTypeResolverBuilder init(JsonTypeInfo.Value settings, TypeIdResolver res)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.init.

Doc from tools.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance, in cases where information could not be passed directly (for example when instantiated for an annotation)

Annotations
@Override
withDefaultImplback to summary
public IonAnnotationTypeResolverBuilder withDefaultImpl(Class<?> newDefaultImpl)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.withDefaultImpl.

Doc from tools.jackson.databind.jsontype.TypeResolverBuilder.withDefaultImpl.

"Mutant factory" method for creating a new instance with different default implementation to use if type id is either not available, or cannot be resolved.

In Jackson 2.x there was instead method defaultImpl() which was a mutator: this method MUST NOT change the underlying state.

Annotations
@Override
withSettingsback to summary
public IonAnnotationTypeResolverBuilder withSettings(JsonTypeInfo.Value settings)

Implements tools.jackson.databind.jsontype.TypeResolverBuilder.withSettings.

Doc from tools.jackson.databind.jsontype.TypeResolverBuilder.withSettings.

Method for overriding type information.

Annotations
@Override