Package | Description |
---|---|
com.google.gson |
This package provides the
Gson class to convert Json to Java and
vice-versa. |
com.google.gson.internal |
Do NOT use any class in this package as they are meant for internal use in Gson.
|
com.google.gson.internal.bind | |
com.google.gson.reflect |
This package provides utility classes for finding type information for generic types.
|
Modifier and Type | Field and Description |
---|---|
private static TypeToken<?> |
Gson.NULL_KEY_SURROGATE |
Modifier and Type | Field and Description |
---|---|
private java.lang.ThreadLocal<java.util.Map<TypeToken<?>,Gson.FutureTypeAdapter<?>>> |
Gson.calls
This thread local guards against reentrant calls to getAdapter().
|
private java.util.Map<TypeToken<?>,TypeAdapter<?>> |
Gson.typeTokenCache |
Modifier and Type | Method and Description |
---|---|
<T> TypeAdapter<T> |
TypeAdapterFactory.create(Gson gson,
TypeToken<T> type)
Returns a type adapter for
type , or null if this factory doesn't
support type . |
<T> TypeAdapter<T> |
Gson.getAdapter(TypeToken<T> type)
Returns the type adapter for type.
|
<T> TypeAdapter<T> |
Gson.getDelegateAdapter(TypeAdapterFactory skipPast,
TypeToken<T> type)
This method is used to get an alternate type adapter for the specified type.
|
Modifier and Type | Method and Description |
---|---|
<T> TypeAdapter<T> |
Excluder.create(Gson gson,
TypeToken<T> type) |
<T> ObjectConstructor<T> |
ConstructorConstructor.get(TypeToken<T> typeToken) |
Modifier and Type | Field and Description |
---|---|
private TypeToken<?> |
TreeTypeAdapter.SingleTypeFactory.exactType |
private TypeToken<T> |
TreeTypeAdapter.typeToken |
Modifier and Type | Method and Description |
---|---|
<T> TypeAdapter<T> |
JsonAdapterAnnotationTypeAdapterFactory.create(Gson gson,
TypeToken<T> targetType) |
<T> TypeAdapter<T> |
MapTypeAdapterFactory.create(Gson gson,
TypeToken<T> typeToken) |
<T> TypeAdapter<T> |
TreeTypeAdapter.SingleTypeFactory.create(Gson gson,
TypeToken<T> type) |
<T> TypeAdapter<T> |
CollectionTypeAdapterFactory.create(Gson gson,
TypeToken<T> typeToken) |
<T> TypeAdapter<T> |
ReflectiveTypeAdapterFactory.create(Gson gson,
TypeToken<T> type) |
private ReflectiveTypeAdapterFactory.BoundField |
ReflectiveTypeAdapterFactory.createBoundField(Gson context,
java.lang.reflect.Field field,
java.lang.String name,
TypeToken<?> fieldType,
boolean serialize,
boolean deserialize) |
private java.util.Map<java.lang.String,ReflectiveTypeAdapterFactory.BoundField> |
ReflectiveTypeAdapterFactory.getBoundFields(Gson context,
TypeToken<?> type,
java.lang.Class<?> raw) |
(package private) TypeAdapter<?> |
JsonAdapterAnnotationTypeAdapterFactory.getTypeAdapter(ConstructorConstructor constructorConstructor,
Gson gson,
TypeToken<?> type,
JsonAdapter annotation) |
static TypeAdapterFactory |
TreeTypeAdapter.newFactory(TypeToken<?> exactType,
java.lang.Object typeAdapter)
Returns a new factory that will match each type against
exactType . |
static <TT> TypeAdapterFactory |
TypeAdapters.newFactory(TypeToken<TT> type,
TypeAdapter<TT> typeAdapter) |
static TypeAdapterFactory |
TreeTypeAdapter.newFactoryWithMatchRawType(TypeToken<?> exactType,
java.lang.Object typeAdapter)
Returns a new factory that will match each type and its raw type against
exactType . |
Constructor and Description |
---|
SingleTypeFactory(java.lang.Object typeAdapter,
TypeToken<?> exactType,
boolean matchRawType,
java.lang.Class<?> hierarchyType) |
TreeTypeAdapter(JsonSerializer<T> serializer,
JsonDeserializer<T> deserializer,
Gson gson,
TypeToken<T> typeToken,
TypeAdapterFactory skipPast) |
Modifier and Type | Method and Description |
---|---|
static <T> TypeToken<T> |
TypeToken.get(java.lang.Class<T> type)
Gets type literal for the given
Class instance. |
static TypeToken<?> |
TypeToken.get(java.lang.reflect.Type type)
Gets type literal for the given
Type instance. |
static TypeToken<?> |
TypeToken.getArray(java.lang.reflect.Type componentType)
Gets type literal for the array type whose elements are all instances of
componentType . |
static TypeToken<?> |
TypeToken.getParameterized(java.lang.reflect.Type rawType,
java.lang.reflect.Type... typeArguments)
Gets type literal for the parameterized type represented by applying
typeArguments to
rawType . |
Modifier and Type | Method and Description |
---|---|
boolean |
TypeToken.isAssignableFrom(TypeToken<?> token)
Deprecated.
this implementation may be inconsistent with javac for types
with wildcards.
|