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

public Class IonAnnotationTypeResolverBuilder

extends Object
implements TypeResolverBuilder<IonAnnotationTypeResolverBuilder>
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder
Imports
java.util.Collection, com.fasterxml.jackson.annotation.JsonTypeInfo, com.fasterxml.jackson.databind.DeserializationConfig, .JavaType, .SerializationConfig, com.fasterxml.jackson.databind.jsontype.NamedType, .TypeDeserializer, .TypeIdResolver, .TypeResolverBuilder, .TypeSerializer

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
public
protected

Method Summary

Modifier and TypeMethod and Description
public TypeDeserializer
public TypeSerializer
public IonAnnotationTypeResolverBuilder
defaultImpl(Class<?> di)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.defaultImpl.

Method for specifying default implementation to use if type id is either not available, or cannot be resolved.

public Class<?>
getDefaultImpl()

Implements com.fasterxml.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
inclusion(JsonTypeInfo.As
Mechanism used for including type metadata in JSON
includeAs
)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.inclusion.

Method for specifying mechanism to use for including type metadata in JSON.

public IonAnnotationTypeResolverBuilder
init(JsonTypeInfo.Id
Which type metadata is used
idType
,
TypeIdResolver
(optional) Custom type id resolver used, if any
res
)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance.

public IonAnnotationTypeResolverBuilder
typeIdVisibility(boolean isVisible)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeIdVisibility.

Method for specifying whether type id should be visible to com.fasterxml.jackson.databind.JsonDeserializers or not.

public IonAnnotationTypeResolverBuilder
typeProperty(String
Name of JSON property to use for including type information
propName
)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeProperty.

Method for specifying name of property used for including type information.

public IonAnnotationTypeResolverBuilder
withDefaultImpl(Class<?> newDefaultImpl)

Overrides default com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.withDefaultImpl.

"Mutant factory" method for creating a new instance with different default implementation.

public IonAnnotationTypeResolverBuilder
withSettings(JsonTypeInfo.Value settings)

Overrides default com.fasterxml.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
public IonAnnotationTypeResolverBuilder()
IonAnnotationTypeResolverBuilderback to summary
protected IonAnnotationTypeResolverBuilder(IonAnnotationTypeResolverBuilder base, Class<?> defaultImpl)

Method Detail

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

Implements com.fasterxml.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(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes)

Implements com.fasterxml.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
defaultImplback to summary
public IonAnnotationTypeResolverBuilder defaultImpl(Class<?> di)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.defaultImpl.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.defaultImpl.

Method for specifying default implementation to use if type id is either not available, or cannot be resolved.

Returns:IonAnnotationTypeResolverBuilder

Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}

Annotations
@Override
getDefaultImplback to summary
public Class<?> getDefaultImpl()

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.getDefaultImpl.

Doc from com.fasterxml.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
inclusionback to summary
public IonAnnotationTypeResolverBuilder inclusion(JsonTypeInfo.As includeAs)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.inclusion.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.inclusion.

Method for specifying mechanism to use for including type metadata in JSON. If not explicitly called, setting defaults to As#PROPERTY.

Parameters
includeAs:JsonTypeInfo.As

Mechanism used for including type metadata in JSON

Returns:IonAnnotationTypeResolverBuilder

Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}

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

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.init.

Initialization method that is called right after constructing the builder instance.

Parameters
idType:JsonTypeInfo.Id

Which type metadata is used

res:TypeIdResolver

(optional) Custom type id resolver used, if any

Returns:IonAnnotationTypeResolverBuilder

Resulting builder instance (usually this builder, but not necessarily)

Annotations
@Override
typeIdVisibilityback to summary
public IonAnnotationTypeResolverBuilder typeIdVisibility(boolean isVisible)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeIdVisibility.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeIdVisibility.

Method for specifying whether type id should be visible to com.fasterxml.jackson.databind.JsonDeserializers or not.

Returns:IonAnnotationTypeResolverBuilder

Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}

Annotations
@Override
typePropertyback to summary
public IonAnnotationTypeResolverBuilder typeProperty(String propName)

Implements com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeProperty.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.typeProperty.

Method for specifying name of property used for including type information. Not used for all inclusion mechanisms; usually only used with As#PROPERTY.

If not explicitly called, name of property to use is based on defaults for com.fasterxml.jackson.annotation.JsonTypeInfo.Id configured.

Parameters
propName:String

Name of JSON property to use for including type information

Returns:IonAnnotationTypeResolverBuilder

Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}

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

Overrides default com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.withDefaultImpl.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.withDefaultImpl.

"Mutant factory" method for creating a new instance with different default implementation.

Returns:IonAnnotationTypeResolverBuilder

Either this instance (if nothing changed) or a new instance with different default implementation

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

Overrides default com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.withSettings.

Doc from com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder.withSettings.

Method for overriding type information.

Annotations
@Override