| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final TreeTypeAdapter | |
| private volatile TypeAdapter | delegate
The delegate is lazily created because it may not be needed, and creating it may fail. |
| private final JsonDeserializer | |
| pack-priv final Gson | |
| private final boolean | |
| private final JsonSerializer | |
| private final TypeAdapterFactory | skipPastForGetDelegateAdapter
Only intended as |
| private final TypeToken |
| Access | Constructor and Description |
|---|---|
| public | TreeTypeAdapter(JsonSerializer<T> serializer, JsonDeserializer<T> deserializer, Gson gson, TypeToken<T> typeToken, TypeAdapterFactory skipPast, boolean nullSafe)
|
| public | TreeTypeAdapter(JsonSerializer<T> serializer, JsonDeserializer<T> deserializer, Gson gson, TypeToken<T> typeToken, TypeAdapterFactory skipPast)
|
| Modifier and Type | Method and Description |
|---|---|
| private TypeAdapter | |
| public TypeAdapter | getSerializationDelegate()
Implements abstract com. Returns the type adapter which is used for serialization. |
| public static TypeAdapterFactory | newFactory(TypeToken<?> exactType, Object typeAdapter)
Returns a new factory that will match each type against |
| public static TypeAdapterFactory | newFactoryWithMatchRawType(TypeToken<?> exactType, Object typeAdapter)
Returns a new factory that will match each type and its raw type against |
| public static TypeAdapterFactory | newTypeHierarchyFactory(Class<?> hierarchyType, Object typeAdapter)
Returns a new factory that will match each type's raw type for assignability to |
| public T | read(JsonReader in)
Implements abstract com. Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object. |
| public void | write(JsonWriter out, T value)
Implements abstract com. Writes one JSON value (an array, object, string, number, boolean or null) for |
| context | back to summary |
|---|---|
| private final TreeTypeAdapter<T>. | |
| delegate | back to summary |
|---|---|
| private volatile TypeAdapter<T> delegate The delegate is lazily created because it may not be needed, and creating it may fail. Field
has to be | |
| deserializer | back to summary |
|---|---|
| private final JsonDeserializer<T> deserializer | |
| gson | back to summary |
|---|---|
| pack-priv final Gson gson | |
| nullSafe | back to summary |
|---|---|
| private final boolean nullSafe | |
| serializer | back to summary |
|---|---|
| private final JsonSerializer<T> serializer | |
| skipPastForGetDelegateAdapter | back to summary |
|---|---|
| private final TypeAdapterFactory skipPastForGetDelegateAdapter Only intended as | |
| typeToken | back to summary |
|---|---|
| private final TypeToken<T> typeToken | |
| TreeTypeAdapter | back to summary |
|---|---|
| public TreeTypeAdapter(JsonSerializer<T> serializer, JsonDeserializer<T> deserializer, Gson gson, TypeToken<T> typeToken, TypeAdapterFactory skipPast, boolean nullSafe) | |
| TreeTypeAdapter | back to summary |
|---|---|
| public TreeTypeAdapter(JsonSerializer<T> serializer, JsonDeserializer<T> deserializer, Gson gson, TypeToken<T> typeToken, TypeAdapterFactory skipPast) | |
| delegate | back to summary |
|---|---|
| private TypeAdapter | |
| getSerializationDelegate | back to summary |
|---|---|
| public TypeAdapter Implements abstract com. Returns the type adapter which is used for serialization. Returns
| |
| newFactory | back to summary |
|---|---|
| public static TypeAdapterFactory newFactory(TypeToken<?> exactType, Object typeAdapter) Returns a new factory that will match each type against | |
| newFactoryWithMatchRawType | back to summary |
|---|---|
| public static TypeAdapterFactory newFactoryWithMatchRawType(TypeToken<?> exactType, Object typeAdapter) Returns a new factory that will match each type and its raw type against | |
| newTypeHierarchyFactory | back to summary |
|---|---|
| public static TypeAdapterFactory newTypeHierarchyFactory(Class<?> hierarchyType, Object typeAdapter) Returns a new factory that will match each type's raw type for assignability to | |
| read | back to summary |
|---|---|
| public T read(JsonReader in) throws IOException Implements abstract com. Doc from com. Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object. Returns the converted object.
| |
| write | back to summary |
|---|---|
| public void write(JsonWriter out, T value) throws IOException Implements abstract com. Doc from com. Writes one JSON value (an array, object, string, number, boolean or null) for
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public <R> R | deserialize(JsonElement json, Type typeOfT)
Implements com. Invokes default deserialization on the specified object. |
| public JsonElement | serialize(Object src)
Implements com. Invokes default serialization on the specified object. |
| public JsonElement | serialize(Object src, Type typeOfSrc)
Implements com. Invokes default serialization on the specified object passing the specific type information. |
| GsonContextImpl | back to summary |
|---|---|
| private GsonContextImpl() | |
| deserialize | back to summary |
|---|---|
| public <R> R deserialize(JsonElement json, Type typeOfT) throws JsonParseException Implements com. Doc from com. Invokes default deserialization on the specified object. It should never be invoked on the
element received as a parameter of the
| |
| serialize | back to summary |
|---|---|
| public JsonElement serialize(Object src) Implements com. Doc from com. Invokes default serialization on the specified object.
| |
| serialize | back to summary |
|---|---|
| public JsonElement serialize(Object src, Type typeOfSrc) Implements com. Doc from com. Invokes default serialization on the specified object passing the specific type information. It
should never be invoked on the element received as a parameter of the
| |
| Modifier and Type | Field and Description |
|---|---|
| private final JsonDeserializer | |
| private final TypeToken | |
| private final Class | |
| private final boolean | |
| private final JsonSerializer |
| Access | Constructor and Description |
|---|---|
| pack-priv | SingleTypeFactory(Object typeAdapter, TypeToken<?> exactType, boolean matchRawType, Class<?> hierarchyType)
|
| Modifier and Type | Method and Description |
|---|---|
| public <T> TypeAdapter | create(Gson gson, TypeToken<T> type)
Implements com. Returns a type adapter for |
| deserializer | back to summary |
|---|---|
| private final JsonDeserializer<?> deserializer | |
| exactType | back to summary |
|---|---|
| private final TypeToken<?> exactType | |
| hierarchyType | back to summary |
|---|---|
| private final Class<?> hierarchyType | |
| matchRawType | back to summary |
|---|---|
| private final boolean matchRawType | |
| serializer | back to summary |
|---|---|
| private final JsonSerializer<?> serializer | |
| SingleTypeFactory | back to summary |
|---|---|
| pack-priv SingleTypeFactory(Object typeAdapter, TypeToken<?> exactType, boolean matchRawType, Class<?> hierarchyType) | |
| create | back to summary |
|---|---|
| public <T> TypeAdapter Implements com. Doc from com. Returns a type adapter for
| |