public class JsonUtils extends Object
| 构造器和说明 |
|---|
JsonUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static com.fasterxml.jackson.databind.node.ArrayNode |
readArray(String jsonStr) |
static <T> List<T> |
readListValue(String jsonStr,
Class<T> clazz) |
static com.fasterxml.jackson.databind.JsonNode |
readNode(InputStream in) |
static com.fasterxml.jackson.databind.JsonNode |
readNode(Reader reader) |
static com.fasterxml.jackson.databind.JsonNode |
readNode(String jsonStr) |
static <T> T |
readValue(Reader reader,
Class<T> clazz) |
static <T> T |
readValue(String jsonStr,
Class<T> clazz) |
static String |
writeJsonStr(Object obj) |
static void |
writeJsonStream(OutputStream out,
Object obj) |
static String |
writePrettyJsonStr(Object obj) |
public static <T> T readValue(String jsonStr, Class<T> clazz) throws IOException
IOExceptionpublic static <T> T readValue(Reader reader, Class<T> clazz) throws IOException
IOExceptionpublic static String writeJsonStr(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static String writePrettyJsonStr(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static void writeJsonStream(OutputStream out, Object obj) throws IOException
IOExceptionpublic static <T> List<T> readListValue(String jsonStr, Class<T> clazz) throws IOException
IOExceptionpublic static com.fasterxml.jackson.databind.node.ArrayNode readArray(String jsonStr) throws IOException
IOExceptionpublic static com.fasterxml.jackson.databind.JsonNode readNode(String jsonStr) throws IOException
IOExceptionpublic static com.fasterxml.jackson.databind.JsonNode readNode(Reader reader) throws IOException
IOExceptionpublic static com.fasterxml.jackson.databind.JsonNode readNode(InputStream in) throws IOException
IOExceptionCopyright © 2021 kubeclub. All rights reserved.