public final class ArrayTypeAdapter<E> extends TypeAdapter<Object>
| 限定符和类型 | 字段和说明 |
|---|---|
static TypeAdapterFactory |
FACTORY |
| 构造器和说明 |
|---|
ArrayTypeAdapter(Gson context,
TypeAdapter<E> componentTypeAdapter,
Class<E> componentType) |
| 限定符和类型 | 方法和说明 |
|---|---|
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,
Object array)
Writes one JSON value (an array, object, string, number, boolean or null)
for
value. |
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTreepublic static final TypeAdapterFactory FACTORY
public ArrayTypeAdapter(Gson context, TypeAdapter<E> componentTypeAdapter, Class<E> componentType)
public Object read(JsonReader in) throws IOException
TypeAdapterread 在类中 TypeAdapter<Object>IOExceptionpublic void write(JsonWriter out, Object array) throws IOException
TypeAdaptervalue.write 在类中 TypeAdapter<Object>array - the Java object to write. May be null.IOException