Package com.google.gson.internal.bind
Class ReflectiveTypeAdapterFactory
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 ReflectionAccessor
private final ConstructorConstructor
private final Excluder
private final FieldNamingStrategy
private final JsonAdapterAnnotationTypeAdapterFactory
-
Constructor Summary
ConstructorsConstructorDescriptionReflectiveTypeAdapterFactory
(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy, Excluder excluder, JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory) -
Method Summary
Modifier and TypeMethodDescription<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
excludeField
(Field f, boolean serialize) (package private) static boolean
excludeField
(Field f, boolean serialize, Excluder excluder) getBoundFields
(Gson context, TypeToken<?> type, Class<?> raw) first element holds the default name
-
Field Details
-
constructorConstructor
-
fieldNamingPolicy
-
excluder
-
jsonAdapterFactory
-
accessor
-
-
Constructor Details
-
ReflectiveTypeAdapterFactory
public ReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructor, FieldNamingStrategy fieldNamingPolicy, Excluder excluder, JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory)
-
-
Method Details
-
excludeField
-
excludeField
-
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
-
createBoundField
private ReflectiveTypeAdapterFactory.BoundField createBoundField(Gson context, Field field, String name, TypeToken<?> fieldType, boolean serialize, boolean deserialize) -
getBoundFields
-