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() |
| Modifier and Type | Method and Description |
|---|---|
void |
doSerialize(JsonWriter writer,
T value,
JsonSerializationContext ctx,
JsonSerializerParameters params)
Serializes a non-null object into JSON output.
|
abstract java.lang.Class |
getSerializedType() |
protected AnyGetterPropertySerializer<T> |
initAnyGetterPropertySerializer()
Initialize the
AnyGetterPropertySerializer. |
protected IdentitySerializationInfo<T> |
initIdentityInfo()
Initialize the
IdentitySerializationInfo. |
protected java.util.Map<java.lang.Class,SubtypeSerializer> |
initMapSubtypeClassToSerializer()
Initialize the
Map containing the SubtypeSerializer. |
protected BeanPropertySerializer[] |
initSerializers()
Initialize the
Map containing the property serializers. |
protected TypeSerializationInfo<T> |
initTypeInfo()
Initialize the
TypeSerializationInfo. |
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,
java.util.Set<java.lang.String> ignoredProperties,
IdentitySerializationInfo identityInfo,
ObjectIdSerializer<?> idWriter,
java.lang.String typeName,
java.lang.String typeInformation)
Serializes all the properties of the bean in a json object.
|
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 java.util.Map<java.lang.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 java.lang.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, java.util.Set<java.lang.String> ignoredProperties, IdentitySerializationInfo identityInfo, ObjectIdSerializer<?> idWriter, java.lang.String typeName, java.lang.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 © 2015. All Rights Reserved.