Package com.google.gson.internal.bind
Class JsonAdapterAnnotationTypeAdapterFactory
- java.lang.Object
-
- com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory
-
- All Implemented Interfaces:
TypeAdapterFactory
public final class JsonAdapterAnnotationTypeAdapterFactory extends java.lang.Object implements TypeAdapterFactory
Given a type T, looks for the annotationJsonAdapter
and uses an instance of the specified class as the default type adapter.- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description private ConstructorConstructor
constructorConstructor
-
Constructor Summary
Constructors Constructor Description JsonAdapterAnnotationTypeAdapterFactory(ConstructorConstructor constructorConstructor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TypeAdapter<T>
create(Gson gson, TypeToken<T> targetType)
Returns a type adapter fortype
, or null if this factory doesn't supporttype
.(package private) TypeAdapter<?>
getTypeAdapter(ConstructorConstructor constructorConstructor, Gson gson, TypeToken<?> type, JsonAdapter annotation)
-
-
-
Field Detail
-
constructorConstructor
private final ConstructorConstructor constructorConstructor
-
-
Constructor Detail
-
JsonAdapterAnnotationTypeAdapterFactory
public JsonAdapterAnnotationTypeAdapterFactory(ConstructorConstructor constructorConstructor)
-
-
Method Detail
-
create
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> targetType)
Description copied from interface:TypeAdapterFactory
Returns a type adapter fortype
, or null if this factory doesn't supporttype
.- Specified by:
create
in interfaceTypeAdapterFactory
-
getTypeAdapter
TypeAdapter<?> getTypeAdapter(ConstructorConstructor constructorConstructor, Gson gson, TypeToken<?> type, JsonAdapter annotation)
-
-