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

public Class IonAnnotationTypeSerializer

extends TypeSerializerBase
Class Inheritance
Imports
com.fasterxml.jackson.annotation.JsonTypeInfo.As, tools.jackson.core.*, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.*, tools.jackson.databind.jsontype.TypeIdResolver, .TypeSerializer, tools.jackson.databind.jsontype.impl.TypeSerializerBase

This is a TypeSerializer that places typing metadata in Ion type annotations. It requires that the underlying JsonGenerator is actually a tools.jackson.dataformat.ion.IonGenerator.

Type serializers are responsible for handling the preamble and postamble of values, in addition to any possible typing metadata (probably because type metadata can affect the pre/postamble content) -- in other words, once a TypeSerializer gets involved, serializers skip normal pre/postambles and assume the TypeSerializer will do it instead. This is why we have to do more than write type metadata in our writeTypePrefix/Suffix* implementations.

See Also
MultipleTypeIdResolver

Field Summary

Inherited from tools.jackson.databind.jsontype.impl.TypeSerializerBase:
_idResolver_property

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected final void
_generateTypeId(DatabindContext ctxt, WritableTypeId idMetadata)

Overrides tools.jackson.databind.jsontype.impl.TypeSerializerBase._generateTypeId.

Helper method that will generate type id to use, if not already passed.

public TypeSerializer
forProperty(SerializationContext ctxt, BeanProperty prop)

Implements abstract tools.jackson.databind.jsontype.TypeSerializer.forProperty.

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

public JsonTypeInfo.As
getTypeInclusion()

Implements abstract tools.jackson.databind.jsontype.impl.TypeSerializerBase.getTypeInclusion.

Accessor for type information inclusion method that serializer uses; indicates how type information is embedded in resulting JSON.

Inherited from tools.jackson.databind.jsontype.impl.TypeSerializerBase:
getPropertyNamegetTypeIdResolverhandleMissingIdidFromValueidFromValueAndTypewriteTypePrefixwriteTypeSuffix

Constructor Detail

IonAnnotationTypeSerializerback to summary
pack-priv IonAnnotationTypeSerializer(TypeIdResolver typeIdResolver)

Method Detail

_generateTypeIdback to summary
protected final void _generateTypeId(DatabindContext ctxt, WritableTypeId idMetadata)

Overrides tools.jackson.databind.jsontype.impl.TypeSerializerBase._generateTypeId.

Doc from tools.jackson.databind.jsontype.impl.TypeSerializerBase._generateTypeId.

Helper method that will generate type id to use, if not already passed.

Annotations
@Override
forPropertyback to summary
public TypeSerializer forProperty(SerializationContext ctxt, BeanProperty prop)

Implements abstract tools.jackson.databind.jsontype.TypeSerializer.forProperty.

Doc from tools.jackson.databind.jsontype.TypeSerializer.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).

Note

since 3.0 has received context object as first argument.

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

Implements abstract tools.jackson.databind.jsontype.impl.TypeSerializerBase.getTypeInclusion.

Doc from tools.jackson.databind.jsontype.TypeSerializer.getTypeInclusion.

Accessor for type information inclusion method that serializer uses; indicates how type information is embedded in resulting JSON.

Annotations
@Override