java.lang.Object
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory
- All Implemented Interfaces:
TypeAdapterFactory
Type adapter that reflects over the fields and methods of a class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConstructorConstructor
private final Excluder
private final FieldNamingStrategy
private final JsonAdapterAnnotationTypeAdapterFactory
private final List<ReflectionAccessFilter>
-
Constructor Summary
ConstructorsConstructorDescriptionReflectiveTypeAdapterFactory
(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy, Excluder excluder, JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory, List<ReflectionAccessFilter> reflectionFilters) -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
checkAccessible
(Object object, Field field) <T> TypeAdapter<T>
Returns a type adapter fortype
, or null if this factory doesn't supporttype
.createBoundField
(Gson context, Field field, String name, TypeToken<?> fieldType, boolean serialize, boolean deserialize, boolean blockInaccessible) getBoundFields
(Gson context, TypeToken<?> type, Class<?> raw, boolean blockInaccessible) first element holds the default nameprivate boolean
includeField
(Field f, boolean serialize)
-
Field Details
-
constructorConstructor
-
fieldNamingPolicy
-
excluder
-
jsonAdapterFactory
-
reflectionFilters
-
-
Constructor Details
-
ReflectiveTypeAdapterFactory
public ReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy, Excluder excluder, JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory, List<ReflectionAccessFilter> reflectionFilters)
-
-
Method Details
-
includeField
-
getFieldNames
first element holds the default name -
create
Description copied from interface:TypeAdapterFactory
Returns a type adapter fortype
, or null if this factory doesn't supporttype
.- Specified by:
create
in interfaceTypeAdapterFactory
-
checkAccessible
-
createBoundField
private ReflectiveTypeAdapterFactory.BoundField createBoundField(Gson context, Field field, String name, TypeToken<?> fieldType, boolean serialize, boolean deserialize, boolean blockInaccessible) -
getBoundFields
-