程序包 gateway.api
类 JsonUtils
java.lang.Object
gateway.api.JsonUtils
JSON工具类
- 作者:
- neeker
-
字段概要
字段修饰符和类型字段说明private static final JsonDateTypeAdapter已过时。private static com.google.gson.Gson已过时。static final Charsetstatic final String -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <T> Tstatic <T> Tstatic <T> TfromJson(InputStream reader, Class<T> toClass) static <T> TfromJson(InputStream reader, Type toClass) static <T> T从JSON中转换为对象static <T> Tstatic com.google.gson.GsongetGson()已过时。static com.google.gson.GsonnewGson()新建一个GSON对象static <T> StringtoJson(T object) 从对象转换为JSON
-
字段详细资料
-
JsonDateFormat
- 另请参阅:
-
DefaultJsonDateTypeAdapter
已过时。 -
JsonCharset
-
gson
已过时。
-
-
构造器详细资料
-
JsonUtils
public JsonUtils()
-
-
方法详细资料
-
getGson
已过时。获取全局GSON对象- 返回:
-
newGson
public static com.google.gson.Gson newGson()新建一个GSON对象- 返回:
-
toJson
从对象转换为JSON- 参数:
object-- 返回:
-
fromJson
从JSON中转换为对象- 参数:
json-toClass-- 返回:
-
fromJson
-
fromJson
-
fromJson
-
fromJson
-
fromJson
-