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

pack-priv final Class SqlTimeTypeAdapter

extends TypeAdapter<Time>
Class Inheritance
Annotations
@SuppressWarnings:JavaUtilDate
Imports
com.google.gson.Gson, .JsonSyntaxException, .TypeAdapter, .TypeAdapterFactory, com.google.gson.reflect.TypeToken, com.google.gson.stream.JsonReader, .JsonToken, .JsonWriter, java.io.IOException, java.sql.Time, java.text.DateFormat, .ParseException, .SimpleDateFormat, java.util.Date, .TimeZone

Adapter for java.sql.Time. Although this class appears stateless, it is not. DateFormat captures its time zone and locale when it is created, which gives this class state. DateFormat isn't thread safe either, so this class has to synchronize its read and write methods.

Field Summary

Modifier and TypeField and Description
pack-priv static final TypeAdapterFactory
private final DateFormat

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Time
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, Time value)

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

FACTORYback to summary
pack-priv static final TypeAdapterFactory FACTORY
formatback to summary
private final DateFormat format

Constructor Detail

SqlTimeTypeAdapterback to summary
private SqlTimeTypeAdapter()

Method Detail

readback to summary
public Time 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, Time value) 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