public abstract class AbstractBeanJsonSerializer<T> extends JsonSerializer<T>
JsonSerializer for beans.| Modifier and Type | Field and Description |
|---|---|
protected BeanPropertySerializer[] |
serializers |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBeanJsonSerializer() |
isDefault, isEmpty, serialize, serialize, serializeNullValueprotected final BeanPropertySerializer[] serializers
protected BeanPropertySerializer[] initSerializers()
Map containing the property serializers. Returns an empty map if there are no properties to
serialize.protected IdentitySerializationInfo<T> initIdentityInfo()
IdentitySerializationInfo. Returns null if there is no JsonIdentityInfo annotation on bean.protected TypeSerializationInfo<T> initTypeInfo()
TypeSerializationInfo. Returns null if there is no JsonTypeInfo annotation on bean.protected Map<Class,SubtypeSerializer> initMapSubtypeClassToSerializer()
Map containing the SubtypeSerializer. Returns an empty map if the bean has no subtypes.protected AnyGetterPropertySerializer<T> initAnyGetterPropertySerializer()
AnyGetterPropertySerializer. Returns null if there is no method annoted with JsonAnyGetter on bean.public abstract Class getSerializedType()
public void doSerialize(JsonWriter writer, @Nonnull T value, JsonSerializationContext ctx, JsonSerializerParameters params)
JsonSerializerdoSerialize in class JsonSerializer<T>writer - JsonWriter used to write the serialized JSONvalue - Object to serializectx - Context for the full serialization processparams - Parameters for this serializationpublic void serializeInternally(JsonWriter writer, T value, JsonSerializationContext ctx, JsonSerializerParameters params, IdentitySerializationInfo<T> defaultIdentityInfo, TypeSerializationInfo<T> defaultTypeInfo)
protected void serializeObject(JsonWriter writer, T value, JsonSerializationContext ctx, Set<String> ignoredProperties, IdentitySerializationInfo identityInfo, ObjectIdSerializer<?> idWriter, String typeName, String typeInformation)
writer - writervalue - bean to serializectx - context of the serialization processignoredProperties - ignored propertiesidentityInfo - identity infoidWriter - identifier writertypeName - in case of type info as property, the name of the propertytypeInformation - in case of type info as property, the type informationCopyright © 2016. All Rights Reserved.