public class JsonUtils extends Object
| 构造器和说明 |
|---|
JsonUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
fromJson(InputStream jsonIn,
Class<T> tClass) |
static <T> T |
fromJson(InputStream jsonIn,
Type type) |
static <T> T |
fromJson(String jsonStr,
Class<T> tClass) |
static <T> T |
fromJson(String jsonStr,
Type type) |
static <T> List<T> |
fromJsonArray(String jsonStr,
TypeReference<List<T>> typeReference) |
static <T> String |
toJsonString(T obj) |
static <T> String |
toJsonString(T obj,
boolean serializeNulls) |
static <T> String |
toJsonString(T obj,
boolean serializeNulls,
String datePattern)
序列化
|
public static <T> String toJsonString(T obj)
public static <T> String toJsonString(T obj, boolean serializeNulls)
public static <T> String toJsonString(T obj, boolean serializeNulls, String datePattern)
T - obj - serializeNulls - 是否需要序列化值为null的字段public static <T> T fromJson(InputStream jsonIn, Class<T> tClass)
public static <T> T fromJson(InputStream jsonIn, Type type)
public static <T> List<T> fromJsonArray(String jsonStr, TypeReference<List<T>> typeReference)
Copyright © 2021. All rights reserved.