public class AsWrapperTypeSerializer extends TypeSerializerBase
JsonTypeInfo.As.WRAPPER_ARRAY
mechanism as fallback: that is,
just use a wrapping array with type information as the first element
and value as second._idResolver, _property
Constructor and Description |
---|
AsWrapperTypeSerializer(TypeIdResolver idRes,
BeanProperty property) |
Modifier and Type | Method and Description |
---|---|
protected String |
_validTypeId(String typeId)
Helper method used to ensure that intended type id is output as something that is valid:
currently only used to ensure that `null` output is converted to an empty String.
|
protected void |
_writeTypeId(JsonGenerator g,
String typeId) |
AsWrapperTypeSerializer |
forProperty(BeanProperty prop)
Method called to create contextual version, to be used for
values of given property.
|
JsonTypeInfo.As |
getTypeInclusion()
Accessor for type information inclusion method
that serializer uses; indicates how type information
is embedded in resulting JSON.
|
_generateTypeId, getPropertyName, getTypeIdResolver, handleMissingId, idFromValue, idFromValueAndType, writeTypePrefix, writeTypeSuffix
_writeLegacySuffix, typeId, typeId, typeId, writeCustomTypePrefixForArray, writeCustomTypePrefixForObject, writeCustomTypePrefixForScalar, writeCustomTypeSuffixForArray, writeCustomTypeSuffixForObject, writeCustomTypeSuffixForScalar, writeTypePrefixForArray, writeTypePrefixForArray, writeTypePrefixForObject, writeTypePrefixForObject, writeTypePrefixForScalar, writeTypePrefixForScalar, writeTypeSuffixForArray, writeTypeSuffixForObject, writeTypeSuffixForScalar
public AsWrapperTypeSerializer(TypeIdResolver idRes, BeanProperty property)
public AsWrapperTypeSerializer forProperty(BeanProperty prop)
TypeSerializer
Collection
or Map
valued properties).forProperty
in class TypeSerializer
public JsonTypeInfo.As getTypeInclusion()
TypeSerializer
getTypeInclusion
in class TypeSerializerBase
protected String _validTypeId(String typeId)
protected final void _writeTypeId(JsonGenerator g, String typeId) throws IOException
IOException
Copyright © 2008–2019 FasterXML. All rights reserved.