程序包 com.easemob.im
类 JSON
java.lang.Object
com.easemob.im.JSON
-
嵌套类概要
嵌套类修饰符和类型类说明static classGson TypeAdapter for Byte Array typestatic classGson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be used.static classGson TypeAdapter for JSR310 LocalDate typestatic classGson TypeAdapter for JSR310 OffsetDateTime typestatic classGson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" format will be used (more efficient than SimpleDateFormat). -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static com.google.gson.GsonBuilderstatic <T> Tdeserialize(String body, Type returnType) Deserialize the given JSON string to Java object.static com.google.gson.GsongetGson()Get Gson.static StringSerialize the given Java object into JSON string.static voidsetDateFormat(DateFormat dateFormat) static voidsetGson(com.google.gson.Gson gson) Set Gson.static voidsetLenientOnJson(boolean lenientOnJson) static voidsetLocalDateFormat(DateTimeFormatter dateFormat) static voidsetOffsetDateTimeFormat(DateTimeFormatter dateFormat) static voidsetSqlDateFormat(DateFormat dateFormat)
-
构造器详细资料
-
JSON
public JSON()
-
-
方法详细资料
-
createGson
public static com.google.gson.GsonBuilder createGson() -
getGson
public static com.google.gson.Gson getGson()Get Gson.- 返回:
- Gson
-
setGson
public static void setGson(com.google.gson.Gson gson) Set Gson.- 参数:
gson- Gson
-
setLenientOnJson
public static void setLenientOnJson(boolean lenientOnJson) -
serialize
Serialize the given Java object into JSON string.- 参数:
obj- Object- 返回:
- String representation of the JSON
-
deserialize
Deserialize the given JSON string to Java object.- 类型参数:
T- Type- 参数:
body- The JSON stringreturnType- The type to deserialize into- 返回:
- The deserialized Java object
-
setOffsetDateTimeFormat
-
setLocalDateFormat
-
setDateFormat
-
setSqlDateFormat
-