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 ConstructorConstructorprivate final Excluderprivate final FieldNamingStrategyprivate final JsonAdapterAnnotationTypeAdapterFactoryprivate final List<ReflectionAccessFilter> -
Constructor Summary
ConstructorsConstructorDescriptionReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy, Excluder excluder, JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory, List<ReflectionAccessFilter> reflectionFilters) -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcheckAccessible(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 booleanincludeField(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:TypeAdapterFactoryReturns a type adapter fortype, or null if this factory doesn't supporttype.- Specified by:
createin interfaceTypeAdapterFactory
-
checkAccessible
-
createBoundField
private ReflectiveTypeAdapterFactory.BoundField createBoundField(Gson context, Field field, String name, TypeToken<?> fieldType, boolean serialize, boolean deserialize, boolean blockInaccessible) -
getBoundFields
-