com.fasterxml.jackson.databind.jsontype.impl

## Class TypeSerializerBase

- java.lang.Object
- - com.fasterxml.jackson.databind.jsontype.TypeSerializer
  - - com.fasterxml.jackson.databind.jsontype.impl.TypeSerializerBase

Direct Known Subclasses:
  AsArrayTypeSerializer, AsExternalTypeSerializer, AsWrapperTypeSerializer

    public abstract class TypeSerializerBase
    extends TypeSerializer

### Field Summary

Fields
`protected TypeIdResolver` `_idResolver`
`protected BeanProperty` `_property`

### Constructor Summary

Constructors
`protected` `TypeSerializerBase(TypeIdResolver idRes, BeanProperty property)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected void` `_generateTypeId(WritableTypeId idMetadata)` Helper method that will generate type id to use, if not already passed.
`String` `getPropertyName()` Name of property that contains type information, if property-based inclusion is used.
`TypeIdResolver` `getTypeIdResolver()` Accessor for object that handles conversions between types and matching type ids.
`abstract JsonTypeInfo.As` `getTypeInclusion()` Accessor for type information inclusion method that serializer uses; indicates how type information is embedded in resulting JSON.
`protected void` `handleMissingId(Object value)`
`protected String` `idFromValue(Object value)`
`protected String` `idFromValueAndType(Object value, Class<?> type)`
`WritableTypeId` `writeTypePrefix(JsonGenerator g, 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.
`WritableTypeId` `writeTypeSuffix(JsonGenerator g, WritableTypeId idMetadata)`

### Methods inherited from class com.fasterxml.jackson.databind.jsontype.TypeSerializer

`_writeLegacySuffix, forProperty, typeId, typeId, typeId, writeCustomTypePrefixForArray, writeCustomTypePrefixForObject, writeCustomTypePrefixForScalar, writeCustomTypeSuffixForArray, writeCustomTypeSuffixForObject, writeCustomTypeSuffixForScalar, writeTypePrefixForArray, writeTypePrefixForArray, writeTypePrefixForObject, writeTypePrefixForObject, writeTypePrefixForScalar, writeTypePrefixForScalar, writeTypeSuffixForArray, writeTypeSuffixForObject, writeTypeSuffixForScalar`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _idResolver

    protected final TypeIdResolver _idResolver

#### _property

    protected final BeanProperty _property

### Constructor Detail

#### TypeSerializerBase

    protected TypeSerializerBase(TypeIdResolver idRes,
                                 BeanProperty property)

### Method Detail

#### getTypeInclusion

    public abstract JsonTypeInfo.As getTypeInclusion()

Description copied from class: `TypeSerializer`
Accessor for type information inclusion method that serializer uses; indicates how type information is embedded in resulting JSON.

Specified by:
  `getTypeInclusion` in class `TypeSerializer`

#### getPropertyName

    public String getPropertyName()

Description copied from class: `TypeSerializer`
Name of property that contains type information, if property-based inclusion is used.

Specified by:
  `getPropertyName` in class `TypeSerializer`

#### getTypeIdResolver

    public TypeIdResolver getTypeIdResolver()

Description copied from class: `TypeSerializer`
Accessor for object that handles conversions between types and matching type ids.

Specified by:
  `getTypeIdResolver` in class `TypeSerializer`

#### writeTypePrefix

    public WritableTypeId writeTypePrefix(JsonGenerator g,
                                          WritableTypeId idMetadata)
                                   throws IOException

Description copied from class: `TypeSerializer`
Method called to write initial part of type information for given value, along with possible wrapping to use: details are specified by `typeId` argument.

Specified by:
  `writeTypePrefix` in class `TypeSerializer`
Parameters:
  `g` - Generator to use for outputting type id and possible wrapping
  `idMetadata` - Details of what type id is to be written, how.
Throws:
  `IOException`

#### writeTypeSuffix

    public WritableTypeId writeTypeSuffix(JsonGenerator g,
                                          WritableTypeId idMetadata)
                                   throws IOException

Specified by:
  `writeTypeSuffix` in class `TypeSerializer`
Throws:
  `IOException`

#### _generateTypeId

    protected void _generateTypeId(WritableTypeId idMetadata)

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

Since:
  2.9

#### idFromValue

    protected String idFromValue(Object value)

#### idFromValueAndType

    protected String idFromValueAndType(Object value,
                                        Class<?> type)

#### handleMissingId

    protected void handleMissingId(Object value)