public class JsonUtils extends Object
| Constructor and Description |
|---|
JsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
createObjectMapper() |
static com.fasterxml.jackson.databind.ObjectMapper |
createObjectMapper(ModuleOptions options) |
static <T> T |
fromInputStream(InputStream content,
Class<T> clazz) |
static <T> T |
fromJsonByteArray(byte[] content,
Class<T> clazz) |
static <T> T |
fromJsonString(String content,
Class<T> clazz) |
static com.fasterxml.jackson.databind.ObjectMapper |
getConfiguredObjectMapper() |
static String |
prettyPrint(String json)
Pretty prints a given JSON string.
|
static byte[] |
toJsonByteArray(Object value) |
static String |
toJsonString(Object value) |
public static com.fasterxml.jackson.databind.ObjectMapper createObjectMapper()
public static com.fasterxml.jackson.databind.ObjectMapper createObjectMapper(ModuleOptions options)
public static byte[] toJsonByteArray(Object value) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static String toJsonString(Object value) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <T> T fromJsonString(String content, Class<T> clazz) throws IOException
IOExceptionpublic static <T> T fromJsonByteArray(byte[] content,
Class<T> clazz)
throws IOException
IOExceptionpublic static <T> T fromInputStream(InputStream content, Class<T> clazz) throws IOException
IOExceptionpublic static com.fasterxml.jackson.databind.ObjectMapper getConfiguredObjectMapper()