Top Fields Constructors Methods
com.google.gson.internal.bind

pack-priv final Class TypeAdapterRuntimeTypeWrapper<T>

extends TypeAdapter<T>
Class Inheritance
Imports
com.google.gson.Gson, .TypeAdapter, com.google.gson.reflect.TypeToken, com.google.gson.stream.JsonReader, .JsonWriter, java.io.IOException, java.lang.reflect.Type, .TypeVariable

Field Summary

Modifier and TypeField and Description
private final Gson
private final TypeAdapter<T>
private final Type

Constructor Summary

AccessConstructor and Description
pack-priv
TypeAdapterRuntimeTypeWrapper(Gson context, TypeAdapter<T> delegate, Type type)

Method Summary

Modifier and TypeMethod and Description
private static Type
getRuntimeTypeIfMoreSpecific(Type type, Object value)

Finds a compatible runtime type if it is more specific

private static boolean
isReflective(TypeAdapter<?>
the type adapter to check.
typeAdapter
)

Returns whether the type adapter uses reflection.

public T
read(JsonReader in)

Implements abstract com.google.gson.TypeAdapter.read.

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.google.gson.TypeAdapter.write.

Writes one JSON value (an array, object, string, number, boolean or null) for value.

Inherited from com.google.gson.TypeAdapter:
fromJsonfromJsonfromJsonTreenullSafetoJsontoJsontoJsonTree

Field Detail

contextback to summary
private final Gson context
delegateback to summary
private final TypeAdapter<T> delegate
typeback to summary
private final Type type

Constructor Detail

TypeAdapterRuntimeTypeWrapperback to summary
pack-priv TypeAdapterRuntimeTypeWrapper(Gson context, TypeAdapter<T> delegate, Type type)

Method Detail

getRuntimeTypeIfMoreSpecificback to summary
private static Type getRuntimeTypeIfMoreSpecific(Type type, Object value)

Finds a compatible runtime type if it is more specific

isReflectiveback to summary
private static boolean isReflective(TypeAdapter<?> typeAdapter)

Returns whether the type adapter uses reflection.

Parameters
typeAdapter:TypeAdapter<?>

the type adapter to check.

readback to summary
public T read(JsonReader in) throws IOException

Implements abstract com.google.gson.TypeAdapter.read.

Doc from com.google.gson.TypeAdapter.read.

Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object. Returns the converted object.

Annotations
@Override
writeback to summary
public void write(JsonWriter out, T value) throws IOException

Implements abstract com.google.gson.TypeAdapter.write.

Doc from com.google.gson.TypeAdapter.write.

Writes one JSON value (an array, object, string, number, boolean or null) for value.

Annotations
@Override