Top Description Methods
com.google.gson

public Interface JsonDeserializationContext

Known Direct Implementers
com.google.gson.internal.bind.TreeTypeAdapter.GsonContextImpl
Imports
java.lang.reflect.Type

Context for deserialization that is passed to a custom deserializer during invocation of its JsonDeserializer#deserialize(JsonElement, Type, JsonDeserializationContext) method.
Authors
Inderjeet Singh, Joel Leitch

Method Summary

Modifier and TypeMethod and Description
public <
The type of the deserialized object.
T
>
T

Returns:

An object of type typeOfT.
deserialize
(JsonElement
the parse tree.
json
,
Type
type of the expected return value.
typeOfT
)

Invokes default deserialization on the specified object.

Method Detail

deserializeback to summary
public <T> T deserialize(JsonElement json, Type typeOfT) throws JsonParseException

Invokes default deserialization on the specified object. It should never be invoked on the element received as a parameter of the JsonDeserializer#deserialize(JsonElement, Type, JsonDeserializationContext) method. Doing so will result in an infinite loop since Gson will in-turn call the custom deserializer again.

Parameters
<T>
The type of the deserialized object.
json:JsonElement

the parse tree.

typeOfT:Type

type of the expected return value.

Returns:T

An object of type typeOfT.

Annotations
@SuppressWarnings:TypeParameterUnusedInFormals
Exceptions
JsonParseException:
if the parse tree does not contain expected data.