接口 Json.JsonCodec
- 封闭类:
- Json
public static interface Json.JsonCodec
The abstract JSON codec interface.
-
方法概要
修饰符和类型方法说明<T> TConvert the given JSON string to an object of the given type.toInputStream(Object o, Class<?> type) Convert the given object to anInputStream.Convert the given object to JSON.
-
方法详细资料
-
toJson
Convert the given object to JSON.- 参数:
o- the object to convert.- 返回:
- the JSON string.
-
fromJson
Convert the given JSON string to an object of the given type.- 类型参数:
T- the type of the object.- 参数:
json- the JSON string.type- the type of the object.- 返回:
- the object.
-
toInputStream
Convert the given object to anInputStream.- 参数:
o- the object to convert.type- the type of the object.- 返回:
- the
InputStream. - 抛出:
IOException- if an I/O error occurs.
-