private final class TreeTypeAdapter.GsonContextImpl extends java.lang.Object implements JsonSerializationContext, JsonDeserializationContext
| Modifier | Constructor and Description |
|---|---|
private |
GsonContextImpl() |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
deserialize(JsonElement json,
java.lang.reflect.Type typeOfT)
Invokes default deserialization on the specified object.
|
JsonElement |
serialize(java.lang.Object src)
Invokes default serialization on the specified object.
|
JsonElement |
serialize(java.lang.Object src,
java.lang.reflect.Type typeOfSrc)
Invokes default serialization on the specified object passing the specific type information.
|
public JsonElement serialize(java.lang.Object src)
JsonSerializationContextserialize in interface JsonSerializationContextsrc - the object that needs to be serialized.JsonElements corresponding to the serialized form of src.public JsonElement serialize(java.lang.Object src, java.lang.reflect.Type typeOfSrc)
JsonSerializationContextJsonSerializer.serialize(Object, Type, JsonSerializationContext) method. Doing
so will result in an infinite loop since Gson will in-turn call the custom serializer again.serialize in interface JsonSerializationContextsrc - the object that needs to be serialized.typeOfSrc - the actual genericized type of src object.JsonElements corresponding to the serialized form of src.public <R> R deserialize(JsonElement json, java.lang.reflect.Type typeOfT) throws JsonParseException
JsonDeserializationContextJsonDeserializer.deserialize(JsonElement, Type, JsonDeserializationContext) method. Doing
so will result in an infinite loop since Gson will in-turn call the custom deserializer again.deserialize in interface JsonDeserializationContextR - The type of the deserialized object.json - the parse tree.typeOfT - type of the expected return value.JsonParseException - if the parse tree does not contain expected data.