Top Description Fields Constructors Methods
com.google.gson.internal.bind

public final Class ArrayTypeAdapter<E>

extends TypeAdapter<Object>
Class Inheritance
Imports
com.google.gson.Gson, .TypeAdapter, .TypeAdapterFactory, com.google.gson.internal.GsonTypes, com.google.gson.reflect.TypeToken, com.google.gson.stream.JsonReader, .JsonToken, .JsonWriter, java.io.IOException, java.lang.reflect.Array, .GenericArrayType, .Type, java.util.ArrayList

Adapter for arrays.

Field Summary

Modifier and TypeField and Description
private final Class<E>
private final TypeAdapter<E>
public static final TypeAdapterFactory

Constructor Summary

AccessConstructor and Description
public
ArrayTypeAdapter(Gson context, TypeAdapter<E> componentTypeAdapter, Class<E> componentType)

Method Summary

Modifier and TypeMethod and Description
public Object
read(JsonReader in)

Implements abstract com.google.gson.TypeAdapter.read.

Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object.

public void
write(JsonWriter out, Object array)

Implements abstract com.google.gson.TypeAdapter.write.

Writes one JSON value (an array, object, string, number, boolean or null) for value.

Inherited from com.google.gson.TypeAdapter:
fromJsonfromJsonfromJsonTreenullSafetoJsontoJsontoJsonTree

Field Detail

componentTypeback to summary
private final Class<E> componentType
componentTypeAdapterback to summary
private final TypeAdapter<E> componentTypeAdapter
FACTORYback to summary
public static final TypeAdapterFactory FACTORY

Constructor Detail

ArrayTypeAdapterback to summary
public ArrayTypeAdapter(Gson context, TypeAdapter<E> componentTypeAdapter, Class<E> componentType)

Method Detail

readback to summary
public Object read(JsonReader in) throws IOException

Implements abstract com.google.gson.TypeAdapter.read.

Doc from com.google.gson.TypeAdapter.read.

Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object. Returns the converted object.

Annotations
@Override
writeback to summary
public void write(JsonWriter out, Object array) throws IOException

Implements abstract com.google.gson.TypeAdapter.write.

Doc from com.google.gson.TypeAdapter.write.

Writes one JSON value (an array, object, string, number, boolean or null) for value.

Annotations
@Override