public class JsonUtils extends Object
| 构造器和说明 |
|---|
JsonUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
fromJsonString(String json,
Class<T> clazz)
Returns the deserialized object from the given json string and target class; or null if the given json string is
null.
|
static com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
static com.fasterxml.jackson.databind.ObjectWriter |
getPrettywriter() |
static com.fasterxml.jackson.databind.ObjectWriter |
getWriter() |
static boolean |
isTotalEncrypt(Set<String> jsonPaths) |
static com.fasterxml.jackson.core.JsonGenerator |
jsonGeneratorOf(Writer writer) |
static com.fasterxml.jackson.databind.JsonNode |
jsonNodeOf(String json) |
static void |
load(InputStream input,
Object obj) |
static void |
load(String content,
Object obj) |
static <T> T |
loadFrom(File file,
Class<T> clazz) |
static <T> T |
loadFrom(InputStream input,
Class<T> clazz) |
static <T> T |
loadFrom(String content,
Class<T> clazz) |
static Set<String> |
resolveAllJsonPaths(String jsonContent,
Set<String> jsonPathPatterns)
正序排列,保证优先加密对象
|
static String |
toJsonPrettyString(Object value) |
static String |
toJsonString(Object value) |
public static String toJsonPrettyString(Object value) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <T> T fromJsonString(String json, Class<T> clazz)
public static com.fasterxml.jackson.databind.JsonNode jsonNodeOf(String json)
public static com.fasterxml.jackson.core.JsonGenerator jsonGeneratorOf(Writer writer) throws IOException
IOExceptionpublic static <T> T loadFrom(File file, Class<T> clazz) throws IOException
IOExceptionpublic static void load(InputStream input, Object obj) throws IOException
IOExceptionpublic static void load(String content, Object obj) throws IOException
IOExceptionpublic static <T> T loadFrom(InputStream input, Class<T> clazz) throws IOException
IOExceptionpublic static <T> T loadFrom(String content, Class<T> clazz) throws IOException
IOExceptionpublic static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public static com.fasterxml.jackson.databind.ObjectWriter getWriter()
public static com.fasterxml.jackson.databind.ObjectWriter getPrettywriter()
Copyright © 2024. All rights reserved.