程序包 gateway.api

类 JsonDateTypeAdapter

java.lang.Object
gateway.api.JsonDateTypeAdapter
所有已实现的接口:
com.google.gson.JsonDeserializer<Date>, com.google.gson.JsonSerializer<Date>

public class JsonDateTypeAdapter extends Object implements com.google.gson.JsonSerializer<Date>, com.google.gson.JsonDeserializer<Date>
  • 字段详细资料

    • localFormat

      private final DateFormat localFormat
    • fixedFormat1

      private final DateFormat fixedFormat1
    • fixedFormat2

      private final DateFormat fixedFormat2
    • fixedFormat3

      private final DateFormat fixedFormat3
    • fixedFormat4

      private final DateFormat fixedFormat4
    • fixedFormat5

      private final DateFormat fixedFormat5
  • 构造器详细资料

    • JsonDateTypeAdapter

      public JsonDateTypeAdapter(String datePattern)
    • JsonDateTypeAdapter

      JsonDateTypeAdapter(DateFormat localFormat)
  • 方法详细资料

    • serialize

      public com.google.gson.JsonElement serialize(Date src, Type typeOfSrc, com.google.gson.JsonSerializationContext context)
      指定者:
      serialize 在接口中 com.google.gson.JsonSerializer<Date>
    • deserialize

      public Date deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
      指定者:
      deserialize 在接口中 com.google.gson.JsonDeserializer<Date>
      抛出:
      com.google.gson.JsonParseException
    • deserializeToDate

      private Date deserializeToDate(com.google.gson.JsonElement json)
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object