public class JacksonUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
private static class |
JacksonUtil.JacksonHolder |
static class |
JacksonUtil.JacksonObjectMapper |
| 构造器和说明 |
|---|
JacksonUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
getInstance() |
static <T> T |
parse(byte[] bytes,
Class<T> valueType)
将json byte 数组反序列化成对象
|
static <T> T |
parse(byte[] bytes,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
将json反序列化成对象
|
static <T> T |
parse(InputStream in,
Class<T> valueType)
将json反序列化成对象
|
static <T> T |
parse(InputStream in,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
将json反序列化成对象
|
static <T> T |
parse(String content,
Class<T> valueType)
将json反序列化成对象
|
static <T> T |
parse(String content,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
将json反序列化成对象
|
static <T> List<T> |
parseArray(String content,
Class<T> valueTypeRef)
将json反序列化成List对象
|
static com.fasterxml.jackson.databind.JsonNode |
readTree(byte[] content)
将json字符串转成 JsonNode
|
static com.fasterxml.jackson.databind.JsonNode |
readTree(InputStream in)
将json字符串转成 JsonNode
|
static com.fasterxml.jackson.databind.JsonNode |
readTree(com.fasterxml.jackson.core.JsonParser jsonParser)
将json字符串转成 JsonNode
|
static com.fasterxml.jackson.databind.JsonNode |
readTree(String jsonString)
将json字符串转成 JsonNode
|
static <T> T |
readValue(byte[] content,
Class<T> valueType)
将json byte 数组反序列化成对象
|
static <T> T |
readValue(byte[] content,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
将json反序列化成对象
|
static <T> T |
readValue(InputStream in,
Class<T> valueType)
将json反序列化成对象
|
static <T> T |
readValue(InputStream in,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
将json反序列化成对象
|
static <T> T |
readValue(String jsonString,
Class<T> valueType)
将json反序列化成对象
|
static <T> T |
readValue(String jsonString,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
将json反序列化成对象
|
static <T> String |
toJson(T value)
将对象序列化成json字符串
|
static byte[] |
toJsonAsBytes(Object object)
将对象序列化成 json byte 数组
|
static Map<String,Object> |
toMap(String content) |
static <T> Map<String,T> |
toMap(String content,
Class<T> valueTypeRef) |
static <T> T |
toPojo(Map fromValue,
Class<T> toValueType) |
public static <T> String toJson(T value)
T - T 泛型标记value - javaBeanpublic static byte[] toJsonAsBytes(Object object)
object - javaBeanpublic static <T> T parse(String content, Class<T> valueType)
T - T 泛型标记content - contentvalueType - classpublic static <T> T parse(String content, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - T 泛型标记content - contenttypeReference - 泛型类型public static <T> T parse(byte[] bytes,
Class<T> valueType)
T - T 泛型标记bytes - json bytesvalueType - classpublic static <T> T parse(byte[] bytes,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - T 泛型标记bytes - bytestypeReference - 泛型类型public static <T> T parse(InputStream in, Class<T> valueType)
T - T 泛型标记in - InputStreamvalueType - classpublic static <T> T parse(InputStream in, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - T 泛型标记in - InputStreamtypeReference - 泛型类型public static <T> List<T> parseArray(String content, Class<T> valueTypeRef)
T - T 泛型标记content - contentvalueTypeRef - classpublic static com.fasterxml.jackson.databind.JsonNode readTree(String jsonString)
jsonString - jsonStringpublic static com.fasterxml.jackson.databind.JsonNode readTree(InputStream in)
in - InputStreampublic static com.fasterxml.jackson.databind.JsonNode readTree(byte[] content)
content - content@Nullable
public static <T> T readValue(@Nullable
byte[] content,
Class<T> valueType)
T - T 泛型标记content - json bytesvalueType - class@Nullable
public static <T> T readValue(@Nullable
String jsonString,
Class<T> valueType)
T - T 泛型标记jsonString - jsonStringvalueType - class@Nullable
public static <T> T readValue(@Nullable
InputStream in,
Class<T> valueType)
T - T 泛型标记in - InputStreamvalueType - class@Nullable
public static <T> T readValue(@Nullable
byte[] content,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - T 泛型标记content - bytestypeReference - 泛型类型@Nullable
public static <T> T readValue(@Nullable
String jsonString,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - T 泛型标记jsonString - jsonStringtypeReference - 泛型类型@Nullable
public static <T> T readValue(@Nullable
InputStream in,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - T 泛型标记in - InputStreamtypeReference - 泛型类型public static com.fasterxml.jackson.databind.JsonNode readTree(com.fasterxml.jackson.core.JsonParser jsonParser)
jsonParser - JsonParserpublic static com.fasterxml.jackson.databind.ObjectMapper getInstance()
Copyright © 2024. All rights reserved.