public class JSONUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
getJsonMapper() |
static String |
toJSON(Object object)
Converting object to JSON string.
|
static <T> T |
toObject(String value,
Class<T> klazz)
Convert string representation to object.
|
static <T> T |
toObject(String value,
com.fasterxml.jackson.databind.type.CollectionType collectionType) |
static <T> T |
toObject(String value,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference) |
public static String toJSON(Object object) throws IOException
object - The object to convert.IOException - IO issuesSwiftJsonMarshallingException - failure to generate JSONpublic static <T> T toObject(String value, Class<T> klazz) throws IOException
value - The JSON string.klazz - The class to convert.IOExceptionpublic static <T> T toObject(String value, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) throws IOException
T - typevalue - json stringtypeReference - class type referenceIOExceptionpublic static <T> T toObject(String value, com.fasterxml.jackson.databind.type.CollectionType collectionType) throws IOException
T - typevalue - json stringcollectionType - class describing how to deserialize collection of objectsIOExceptionpublic static com.fasterxml.jackson.databind.ObjectMapper getJsonMapper()
Copyright © 2008–2021 Apache Software Foundation. All rights reserved.