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

public Class IonAnnotationTypeSerializer

extends TypeSerializerBase
Class Inheritance
Imports
com.fasterxml.jackson.annotation.JsonTypeInfo.As, com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.type.WritableTypeId, com.fasterxml.jackson.databind.BeanProperty, com.fasterxml.jackson.databind.jsontype.TypeIdResolver, .TypeSerializer, com.fasterxml.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 com.fasterxml.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 com.fasterxml.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(WritableTypeId idMetadata)

Overrides com.fasterxml.jackson.databind.jsontype.impl.TypeSerializerBase._generateTypeId.

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

public TypeSerializer
forProperty(BeanProperty prop)

Implements abstract com.fasterxml.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 com.fasterxml.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 com.fasterxml.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(WritableTypeId idMetadata)

Overrides com.fasterxml.jackson.databind.jsontype.impl.TypeSerializerBase._generateTypeId.

Doc from com.fasterxml.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(BeanProperty prop)

Implements abstract com.fasterxml.jackson.databind.jsontype.TypeSerializer.forProperty.

Doc from com.fasterxml.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).

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

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

Doc from com.fasterxml.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