java.lang.Object
tools.jackson.databind.jsontype.TypeSerializer
tools.jackson.databind.jsontype.impl.TypeSerializerBase
- Direct Known Subclasses:
AsArrayTypeSerializer,AsDeductionTypeSerializer,AsExistingPropertyTypeSerializer,AsExternalTypeSerializer,AsPropertyTypeSerializer,AsWrapperTypeSerializer
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypeSerializerBase(TypeIdResolver idRes, BeanProperty property) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_generateTypeId(DatabindContext ctxt, WritableTypeId idMetadata) Helper method that will generate type id to use, if not already passed.Name of property that contains type information, if property-based inclusion is used.Accessor for object that handles conversions between types and matching type ids.abstract JsonTypeInfo.AsAccessor for type information inclusion method that serializer uses; indicates how type information is embedded in resulting JSON.protected voidhandleMissingId(Object value) protected StringidFromValue(DatabindContext ctxt, Object value) protected StringidFromValueAndType(DatabindContext ctxt, Object value, Class<?> type) writeTypePrefix(JsonGenerator g, SerializationContext ctxt, WritableTypeId idMetadata) Method called to write initial part of type information for given value, along with possible wrapping to use: details are specified by `typeId` argument.writeTypeSuffix(JsonGenerator g, SerializationContext ctxt, WritableTypeId idMetadata) Method called to write the "closing" part of type information for given value, along with possible closing wrapping to use: details are specified by `typeId` argument, which should be one returned from an earlier matching call towriteTypePrefix(...).Methods inherited from class tools.jackson.databind.jsontype.TypeSerializer
forProperty, typeId, typeId, typeId
-
Field Details
-
_idResolver
-
_property
-
-
Constructor Details
-
TypeSerializerBase
-
-
Method Details
-
getTypeInclusion
Description copied from class:TypeSerializerAccessor for type information inclusion method that serializer uses; indicates how type information is embedded in resulting JSON.- Specified by:
getTypeInclusionin classTypeSerializer
-
getPropertyName
Description copied from class:TypeSerializerName of property that contains type information, if property-based inclusion is used.- Specified by:
getPropertyNamein classTypeSerializer
-
getTypeIdResolver
Description copied from class:TypeSerializerAccessor for object that handles conversions between types and matching type ids.- Specified by:
getTypeIdResolverin classTypeSerializer
-
writeTypePrefix
public WritableTypeId writeTypePrefix(JsonGenerator g, SerializationContext ctxt, WritableTypeId idMetadata) throws JacksonException Description copied from class:TypeSerializerMethod called to write initial part of type information for given value, along with possible wrapping to use: details are specified by `typeId` argument. Note that for structured types (Object, Array), this call will add necessary start token so it should NOT be explicitly written, unlike with non-type-id value writes.- Specified by:
writeTypePrefixin classTypeSerializer- Parameters:
g- Generator to use for outputting type id and possible wrappingidMetadata- Details of what type id is to be written, how.- Throws:
JacksonException
-
writeTypeSuffix
public WritableTypeId writeTypeSuffix(JsonGenerator g, SerializationContext ctxt, WritableTypeId idMetadata) throws JacksonException Description copied from class:TypeSerializerMethod called to write the "closing" part of type information for given value, along with possible closing wrapping to use: details are specified by `typeId` argument, which should be one returned from an earlier matching call towriteTypePrefix(...).- Specified by:
writeTypeSuffixin classTypeSerializer- Parameters:
g- Generator to use for outputting type id and possible wrappingidMetadata- Details of what type id is to be written, how.- Throws:
JacksonException
-
_generateTypeId
Helper method that will generate type id to use, if not already passed. -
idFromValue
-
idFromValueAndType
-
handleMissingId
-