public final class JSON extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
parseArray(String json,
Class<T> clazz)
转化json 编程数组
|
static <T> T |
parseObject(byte[] body,
Charset charset,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
转换字节数组为复杂对象
|
static <T> T |
parseObject(String json,
Class<T> clazz)
转换json 变成对象
|
static <T> T |
parseObject(String json,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
转换json 变成复杂泛型对象
|
static String |
toJSONString(Object object)
序列化对象编程json 字符串
|
public static String toJSONString(Object object)
object - 对象public static <T> T parseObject(String json, Class<T> clazz)
T - 实体类json - json 字符串clazz - 实体public static <T> T parseObject(String json, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - 实体类json - json 字符串typeReference - 复杂泛型类型public static <T> T parseObject(byte[] body,
Charset charset,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - 实体类body - 字节数组charset - 编码方式typeReference - 复杂泛型类型Copyright © 2021 wz2cool. All rights reserved.