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 |
Modifier and Type | Class and Description |
---|---|
private static class |
TreeTypeAdapter.SingleTypeFactory |
Modifier and Type | Field and Description |
---|---|
private TypeAdapterFactory |
TreeTypeAdapter.skipPast |
Modifier and Type | Field and Description |
---|---|
private java.util.List<TypeAdapterFactory> |
GsonBuilder.factories |
private java.util.List<TypeAdapterFactory> |
Gson.factories |
private java.util.List<TypeAdapterFactory> |
GsonBuilder.hierarchyFactories
tree-style hierarchy factories.
|
Modifier and Type | Method and Description |
---|---|
static TypeAdapterFactory |
TreeTypeAdapter.newFactory(TypeToken<?> exactType,
java.lang.Object typeAdapter)
Returns a new factory that will match each type against
exactType . |
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 . |
static TypeAdapterFactory |
TreeTypeAdapter.newTypeHierarchyFactory(java.lang.Class<?> hierarchyType,
java.lang.Object typeAdapter)
Returns a new factory that will match each type's raw type for assignability
to
hierarchyType . |
Modifier and Type | Method and Description |
---|---|
<T> TypeAdapter<T> |
Gson.getDelegateAdapter(TypeAdapterFactory skipPast,
TypeToken<T> type)
This method is used to get an alternate type adapter for the specified type.
|
GsonBuilder |
GsonBuilder.registerTypeAdapterFactory(TypeAdapterFactory factory)
Register a factory for type adapters.
|
Modifier and Type | Method and Description |
---|---|
private void |
GsonBuilder.addTypeAdaptersForDate(java.lang.String datePattern,
int dateStyle,
int timeStyle,
java.util.List<TypeAdapterFactory> factories) |
Constructor and Description |
---|
TreeTypeAdapter(JsonSerializer<T> serializer,
JsonDeserializer<T> deserializer,
Gson gson,
TypeToken<T> typeToken,
TypeAdapterFactory skipPast) |
Constructor and Description |
---|
Gson(Excluder excluder,
FieldNamingStrategy fieldNamingPolicy,
java.util.Map<java.lang.reflect.Type,InstanceCreator<?>> instanceCreators,
boolean serializeNulls,
boolean complexMapKeySerialization,
boolean generateNonExecutableGson,
boolean htmlSafe,
boolean prettyPrinting,
boolean serializeSpecialFloatingPointValues,
LongSerializationPolicy longSerializationPolicy,
java.util.List<TypeAdapterFactory> typeAdapterFactories) |
Modifier and Type | Class and Description |
---|---|
class |
Excluder
This class selects which fields and types to omit.
|
Modifier and Type | Class and Description |
---|---|
class |
CollectionTypeAdapterFactory
Adapt a homogeneous collection of objects.
|
class |
JsonAdapterAnnotationTypeAdapterFactory
Given a type T, looks for the annotation
JsonAdapter and uses an instance of the
specified class as the default type adapter. |
class |
MapTypeAdapterFactory
Adapts maps to either JSON objects or JSON arrays.
|
class |
ReflectiveTypeAdapterFactory
Type adapter that reflects over the fields and methods of a class.
|
Modifier and Type | Method and Description |
---|---|
static <TT> TypeAdapterFactory |
TypeAdapters.newFactory(java.lang.Class<TT> unboxed,
java.lang.Class<TT> boxed,
TypeAdapter<? super TT> typeAdapter) |
static <TT> TypeAdapterFactory |
TypeAdapters.newFactory(java.lang.Class<TT> type,
TypeAdapter<TT> typeAdapter) |
static <TT> TypeAdapterFactory |
TypeAdapters.newFactory(TypeToken<TT> type,
TypeAdapter<TT> typeAdapter) |
static <TT> TypeAdapterFactory |
TypeAdapters.newFactoryForMultipleTypes(java.lang.Class<TT> base,
java.lang.Class<? extends TT> sub,
TypeAdapter<? super TT> typeAdapter) |
static <TT> TypeAdapterFactory |
TypeAdapters.newTypeHierarchyFactory(java.lang.Class<TT> clazz,
TypeAdapter<TT> typeAdapter) |