Package com.google.gson.internal.bind
Class CollectionTypeAdapterFactory.Adapter<E>
- java.lang.Object
-
- com.google.gson.TypeAdapter<java.util.Collection<E>>
-
- com.google.gson.internal.bind.CollectionTypeAdapterFactory.Adapter<E>
-
- Enclosing class:
- CollectionTypeAdapterFactory
private static final class CollectionTypeAdapterFactory.Adapter<E> extends TypeAdapter<java.util.Collection<E>>
-
-
Field Summary
Fields Modifier and Type Field Description private ObjectConstructor<? extends java.util.Collection<E>>
constructor
private TypeAdapter<E>
elementTypeAdapter
-
Constructor Summary
Constructors Constructor Description Adapter(Gson context, java.lang.reflect.Type elementType, TypeAdapter<E> elementTypeAdapter, ObjectConstructor<? extends java.util.Collection<E>> constructor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<E>
read(JsonReader in)
Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object.void
write(JsonWriter out, java.util.Collection<E> collection)
Writes one JSON value (an array, object, string, number, boolean or null) forvalue
.-
Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
-
-
-
Field Detail
-
elementTypeAdapter
private final TypeAdapter<E> elementTypeAdapter
-
constructor
private final ObjectConstructor<? extends java.util.Collection<E>> constructor
-
-
Constructor Detail
-
Adapter
public Adapter(Gson context, java.lang.reflect.Type elementType, TypeAdapter<E> elementTypeAdapter, ObjectConstructor<? extends java.util.Collection<E>> constructor)
-
-
Method Detail
-
read
public java.util.Collection<E> read(JsonReader in) throws java.io.IOException
Description copied from class:TypeAdapter
Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object. Returns the converted object.- Specified by:
read
in classTypeAdapter<java.util.Collection<E>>
- Returns:
- the converted Java object. May be null.
- Throws:
java.io.IOException
-
write
public void write(JsonWriter out, java.util.Collection<E> collection) throws java.io.IOException
Description copied from class:TypeAdapter
Writes one JSON value (an array, object, string, number, boolean or null) forvalue
.- Specified by:
write
in classTypeAdapter<java.util.Collection<E>>
collection
- the Java object to write. May be null.- Throws:
java.io.IOException
-
-