public class AsExternalTypeSerializer extends TypeSerializerBase
AsPropertyTypeSerializer.
Note that implementation of serialization is bit cumbersome as we must serialized external type id AFTER object; this because callback only occurs after field name has been written.
Also note that this type of type id inclusion will NOT try to make use of native Type Ids, even if those exist.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
_typePropertyName |
_idResolver, _property| Constructor and Description |
|---|
AsExternalTypeSerializer(TypeIdResolver idRes,
BeanProperty property,
java.lang.String propName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_writeArrayPrefix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g) |
protected void |
_writeArraySuffix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g,
java.lang.String typeId) |
protected void |
_writeObjectPrefix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g) |
protected void |
_writeObjectSuffix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g,
java.lang.String typeId) |
protected void |
_writeScalarPrefix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g) |
protected void |
_writeScalarSuffix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g,
java.lang.String typeId) |
AsExternalTypeSerializer |
forProperty(BeanProperty prop)
Method called to create contextual version, to be used for
values of given property.
|
java.lang.String |
getPropertyName()
Name of property that contains type information, if
property-based inclusion is used.
|
com.fasterxml.jackson.annotation.JsonTypeInfo.As |
getTypeInclusion()
Accessor for type information inclusion method
that serializer uses; indicates how type information
is embedded in resulting JSON.
|
_generateTypeId, getTypeIdResolver, handleMissingId, idFromValue, idFromValueAndType, writeTypePrefix, writeTypeSuffix_writeLegacySuffix, typeId, typeId, typeId, writeCustomTypePrefixForArray, writeCustomTypePrefixForObject, writeCustomTypePrefixForScalar, writeCustomTypeSuffixForArray, writeCustomTypeSuffixForObject, writeCustomTypeSuffixForScalar, writeTypePrefixForArray, writeTypePrefixForArray, writeTypePrefixForObject, writeTypePrefixForObject, writeTypePrefixForScalar, writeTypePrefixForScalar, writeTypeSuffixForArray, writeTypeSuffixForObject, writeTypeSuffixForScalarpublic AsExternalTypeSerializer(TypeIdResolver idRes, BeanProperty property, java.lang.String propName)
public AsExternalTypeSerializer forProperty(BeanProperty prop)
TypeSerializerCollection or Map
valued properties).forProperty in class TypeSerializerpublic java.lang.String getPropertyName()
TypeSerializergetPropertyName in class TypeSerializerBasepublic com.fasterxml.jackson.annotation.JsonTypeInfo.As getTypeInclusion()
TypeSerializergetTypeInclusion in class TypeSerializerBaseprotected final void _writeScalarPrefix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g)
throws java.io.IOException
java.io.IOExceptionprotected final void _writeObjectPrefix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g)
throws java.io.IOException
java.io.IOExceptionprotected final void _writeArrayPrefix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g)
throws java.io.IOException
java.io.IOExceptionprotected final void _writeScalarSuffix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g,
java.lang.String typeId)
throws java.io.IOException
java.io.IOExceptionprotected final void _writeObjectSuffix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g,
java.lang.String typeId)
throws java.io.IOException
java.io.IOExceptionprotected final void _writeArraySuffix(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator g,
java.lang.String typeId)
throws java.io.IOException
java.io.IOException