Class JsonAdapterAnnotationTypeAdapterFactory

java.lang.Object
com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory
All Implemented Interfaces:
TypeAdapterFactory

public final class JsonAdapterAnnotationTypeAdapterFactory extends Object implements TypeAdapterFactory
Given a type T, looks for the annotation JsonAdapter and uses an instance of the specified class as the default type adapter.
Since:
2.3
  • Constructor Details

    • JsonAdapterAnnotationTypeAdapterFactory

      public JsonAdapterAnnotationTypeAdapterFactory(ConstructorConstructor constructorConstructor)
  • Method Details

    • create

      public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> targetType)
      Description copied from interface: TypeAdapterFactory
      Returns a type adapter for type, or null if this factory doesn't support type.
      Specified by:
      create in interface TypeAdapterFactory
    • isClassJsonAdapterFactory

      public boolean isClassJsonAdapterFactory(TypeToken<?> type, TypeAdapterFactory factory)
      Returns whether factory is a type adapter factory created for @JsonAdapter placed on type.