public final class ArrayTypeAdapter<E> extends TypeAdapter<java.lang.Object>
Modifier and Type | Field and Description |
---|---|
static TypeAdapterFactory |
FACTORY |
Constructor and Description |
---|
ArrayTypeAdapter(Gson context,
TypeAdapter<E> componentTypeAdapter,
java.lang.Class<E> componentType) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
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.lang.Object array)
Writes one JSON value (an array, object, string, number, boolean or null)
for
value . |
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
public static final TypeAdapterFactory FACTORY
public ArrayTypeAdapter(Gson context, TypeAdapter<E> componentTypeAdapter, java.lang.Class<E> componentType)
public java.lang.Object read(JsonReader in) throws java.io.IOException
TypeAdapter
read
in class TypeAdapter<java.lang.Object>
java.io.IOException
public void write(JsonWriter out, java.lang.Object array) throws java.io.IOException
TypeAdapter
value
.write
in class TypeAdapter<java.lang.Object>
array
- the Java object to write. May be null.java.io.IOException