public class AsExistingPropertyTypeSerializer extends AsPropertyTypeSerializer
JsonTypeInfo.As.EXISTING_PROPERTY inclusion mechanism.
Expects type information to be a well-defined property on all sub-classes._typePropertyName_idResolver, _property| Constructor and Description |
|---|
AsExistingPropertyTypeSerializer(TypeIdResolver idRes,
BeanProperty property,
String propName) |
| Modifier and Type | Method and Description |
|---|---|
AsExistingPropertyTypeSerializer |
forProperty(BeanProperty prop)
Method called to create contextual version, to be used for
values of given property.
|
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.
|
void |
writeCustomTypePrefixForObject(Object value,
com.fasterxml.jackson.core.JsonGenerator jgen,
String typeId)
Method called to write initial part of type information for given
value, when it will be output as JSON Object value (not as JSON
Array or scalar),
using specified custom type id instead of calling
TypeIdResolver. |
void |
writeTypePrefixForObject(Object value,
com.fasterxml.jackson.core.JsonGenerator jgen)
Method called to write initial part of type information for given
value, when it will be output as JSON Object value (not as JSON
Array or scalar).
|
void |
writeTypePrefixForObject(Object value,
com.fasterxml.jackson.core.JsonGenerator jgen,
Class<?> type)
Alternative version of the prefix-for-object method, which is given
actual type to use (instead of using exact type of the value); typically
a super type of actual value type
|
getPropertyName, writeCustomTypeSuffixForObject, writeTypeSuffixForObjectwriteCustomTypePrefixForArray, writeCustomTypePrefixForScalar, writeCustomTypeSuffixForArray, writeCustomTypeSuffixForScalar, writeTypePrefixForArray, writeTypePrefixForArray, writeTypePrefixForScalar, writeTypePrefixForScalar, writeTypeSuffixForArray, writeTypeSuffixForScalargetTypeIdResolver, handleMissingId, idFromValue, idFromValueAndTypepublic AsExistingPropertyTypeSerializer(TypeIdResolver idRes, BeanProperty property, String propName)
public AsExistingPropertyTypeSerializer forProperty(BeanProperty prop)
TypeSerializerCollection or Map
valued properties).forProperty in class AsPropertyTypeSerializerpublic com.fasterxml.jackson.annotation.JsonTypeInfo.As getTypeInclusion()
TypeSerializergetTypeInclusion in class AsPropertyTypeSerializerpublic void writeTypePrefixForObject(Object value, com.fasterxml.jackson.core.JsonGenerator jgen) throws IOException
TypeSerializerwriteTypePrefixForObject in class AsPropertyTypeSerializervalue - Value that will be serialized, for which type information is
to be writtenjgen - Generator to use for writing type informationIOExceptionpublic void writeTypePrefixForObject(Object value, com.fasterxml.jackson.core.JsonGenerator jgen, Class<?> type) throws IOException
TypeSerializerwriteTypePrefixForObject in class AsPropertyTypeSerializerIOExceptionpublic void writeCustomTypePrefixForObject(Object value, com.fasterxml.jackson.core.JsonGenerator jgen, String typeId) throws IOException
TypeSerializerTypeIdResolver.
This means that context after call must be JSON Object, meaning that
caller can then proceed to output field entries.writeCustomTypePrefixForObject in class AsPropertyTypeSerializervalue - Value that will be serialized, for which type information is
to be writtenjgen - Generator to use for writing type informationtypeId - Exact type id to useIOExceptionCopyright © 2014–2015 FasterXML. All rights reserved.