public class DateJsonSerializer
extends java.lang.Object
implements com.google.gson.JsonSerializer<java.util.Date>, com.google.gson.JsonDeserializer<java.util.Date>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE_FORMAT |
static org.apache.commons.lang3.time.FastDateFormat |
DATE_FORMATTER |
Constructor and Description |
---|
DateJsonSerializer() |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
deserialize(com.google.gson.JsonElement json,
java.lang.reflect.Type typeOfT,
com.google.gson.JsonDeserializationContext context) |
com.google.gson.JsonElement |
serialize(java.util.Date src,
java.lang.reflect.Type typeOfSrc,
com.google.gson.JsonSerializationContext context) |
public static final java.lang.String DATE_FORMAT
public static final org.apache.commons.lang3.time.FastDateFormat DATE_FORMATTER
public com.google.gson.JsonElement serialize(java.util.Date src, java.lang.reflect.Type typeOfSrc, com.google.gson.JsonSerializationContext context)
serialize
in interface com.google.gson.JsonSerializer<java.util.Date>
public java.util.Date deserialize(com.google.gson.JsonElement json, java.lang.reflect.Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
deserialize
in interface com.google.gson.JsonDeserializer<java.util.Date>
com.google.gson.JsonParseException