public class JSONUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.codehaus.jackson.map.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,
org.codehaus.jackson.map.type.CollectionType collectionType) |
static <T> T |
toObject(String value,
org.codehaus.jackson.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, org.codehaus.jackson.type.TypeReference<T> typeReference) throws IOException
T - typevalue - json stringtypeReference - class type referenceIOExceptionpublic static <T> T toObject(String value, org.codehaus.jackson.map.type.CollectionType collectionType) throws IOException
T - typevalue - json stringcollectionType - class describing how to deserialize collection of objectsIOExceptionpublic static org.codehaus.jackson.map.ObjectMapper getJsonMapper()
Copyright © 2018 CERN. All Rights Reserved.