程序包 com.volcengine
类 JSON
- java.lang.Object
-
- com.volcengine.JSON
-
public class JSON extends Object
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classJSON.DateTypeAdapterGson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be used.classJSON.LocalDateTypeAdapterGson TypeAdapter for JSR310 LocalDate typestatic classJSON.OffsetDateTimeTypeAdapterGson TypeAdapter for JSR310 OffsetDateTime typestatic classJSON.SqlDateTypeAdapterGson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" format will be used (more efficient than SimpleDateFormat).
-
构造器概要
构造器 构造器 说明 JSON()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static com.google.gson.GsonBuildercreateGson()<T> Tdeserialize(String body, Type returnType)Deserialize the given JSON string to Java object.com.google.gson.GsongetGson()Get Gson.Stringserialize(Object obj)Serialize the given Java object into JSON string.JSONsetDateFormat(DateFormat dateFormat)JSONsetGson(com.google.gson.Gson gson)Set Gson.JSONsetLenientOnJson(boolean lenientOnJson)JSONsetLocalDateFormat(org.threeten.bp.format.DateTimeFormatter dateFormat)JSONsetOffsetDateTimeFormat(org.threeten.bp.format.DateTimeFormatter dateFormat)JSONsetSqlDateFormat(DateFormat dateFormat)
-
-
-
方法详细资料
-
createGson
public static com.google.gson.GsonBuilder createGson()
-
getGson
public com.google.gson.Gson getGson()
Get Gson.- 返回:
- Gson
-
setGson
public JSON setGson(com.google.gson.Gson gson)
Set Gson.- 参数:
gson- Gson- 返回:
- JSON
-
setLenientOnJson
public JSON setLenientOnJson(boolean lenientOnJson)
-
serialize
public String serialize(Object obj)
Serialize the given Java object into JSON string.- 参数:
obj- Object- 返回:
- String representation of the JSON
-
deserialize
public <T> T deserialize(String body, Type returnType)
Deserialize the given JSON string to Java object.- 类型参数:
T- Type- 参数:
body- The JSON stringreturnType- The type to deserialize into- 返回:
- The deserialized Java object
-
setOffsetDateTimeFormat
public JSON setOffsetDateTimeFormat(org.threeten.bp.format.DateTimeFormatter dateFormat)
-
setLocalDateFormat
public JSON setLocalDateFormat(org.threeten.bp.format.DateTimeFormatter dateFormat)
-
setDateFormat
public JSON setDateFormat(DateFormat dateFormat)
-
setSqlDateFormat
public JSON setSqlDateFormat(DateFormat dateFormat)
-
-