public class DateSerializer extends Object implements com.google.gson.JsonSerializer<Date>, com.google.gson.JsonDeserializer<Date>
| Constructor and Description |
|---|
DateSerializer() |
| Modifier and Type | Method and Description |
|---|---|
Date |
deserialize(com.google.gson.JsonElement element,
Type type,
com.google.gson.JsonDeserializationContext ctx)
Deserializes a JsonElement containing an ISO-8601 formatted date
|
static Date |
deserialize(String strVal)
Deserializes an ISO-8601 formatted date
|
static String |
serialize(Date date)
Serializes a Date object to an ISO-8601 formatted date string
|
com.google.gson.JsonElement |
serialize(Date date,
Type type,
com.google.gson.JsonSerializationContext ctx)
Serializes a Date to a JsonElement containing a ISO-8601 formatted date
|
public Date deserialize(com.google.gson.JsonElement element, Type type, com.google.gson.JsonDeserializationContext ctx) throws com.google.gson.JsonParseException
deserialize in interface com.google.gson.JsonDeserializer<Date>element - JsonElementtype - Typectx - JsonDeserializationContextcom.google.gson.JsonParseExceptionpublic com.google.gson.JsonElement serialize(Date date, Type type, com.google.gson.JsonSerializationContext ctx)
serialize in interface com.google.gson.JsonSerializer<Date>date - Datetype - Typectx - JsonSerializationContextpublic static Date deserialize(String strVal) throws ParseException
strVal - STringParseException - Parse ExceptionCopyright © 2019. All rights reserved.