public abstract class JsonSerializer<T> extends Object
| Constructor and Description |
|---|
JsonSerializer() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doSerialize(JsonWriter writer,
T value,
JsonSerializationContext ctx,
JsonSerializerParameters params)
Serializes a non-null object into JSON output.
|
protected boolean |
isAbsent(T value) |
protected boolean |
isDefault(T value) |
protected boolean |
isEmpty(T value) |
void |
serialize(JsonWriter writer,
T value,
JsonSerializationContext ctx)
Serializes an object into JSON output.
|
void |
serialize(JsonWriter writer,
T value,
JsonSerializationContext ctx,
JsonSerializerParameters params)
Serializes an object into JSON output.
|
protected void |
serializeNullValue(JsonWriter writer,
JsonSerializationContext ctx,
JsonSerializerParameters params)
Serialize the null value.
|
public void serialize(JsonWriter writer, T value, JsonSerializationContext ctx) throws JsonSerializationException
writer - JsonWriter used to write the serialized JSONvalue - Object to serializectx - Context for the full serialization processJsonSerializationException - if an error occurs during the serializationpublic void serialize(JsonWriter writer, T value, JsonSerializationContext ctx, JsonSerializerParameters params) throws JsonSerializationException
writer - JsonWriter used to write the serialized JSONvalue - Object to serializectx - Context for the full serialization processparams - Parameters for this serializationJsonSerializationException - if an error occurs during the serializationprotected void serializeNullValue(JsonWriter writer, JsonSerializationContext ctx, JsonSerializerParameters params)
writer - JsonWriter used to write the serialized JSONctx - Context for the full serialization processparams - Parameters for this serializationprotected boolean isDefault(T value)
value - the valueprotected boolean isEmpty(T value)
value - the valueprotected boolean isAbsent(T value)
value - the valueprotected abstract void doSerialize(JsonWriter writer, T value, JsonSerializationContext ctx, JsonSerializerParameters params)
writer - JsonWriter used to write the serialized JSONvalue - Object to serializectx - Context for the full serialization processparams - Parameters for this serializationCopyright © 2017. All Rights Reserved.