public class JsonMapper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
readValue(String jsonString,
Class<T> c)
Unmarshalls a JSON string into a Java object.
|
static <T> void |
writeValue(T o,
Class<T> c,
List<String> arrayProperties,
OutputStream os)
Marshalls a Java object into a JSON string and writes it to an
OutputStream. |
static <T> void |
writeValue(T o,
OutputStream os)
Marshalls a Java object into a JSON string and writes it to an
OutputStream. |
static <T> String |
writeValueAsString(T o)
Marshalls a Java object into a JSON string.
|
static <T> String |
writeValueAsString(T o,
Class<T> c,
List<String> arrayProperties)
Marshalls a Java object into a JSON string.
|
static <T> String |
writeValueAsString(T o,
List<String> arrayProperties)
Marshalls a Java object into a JSON string.
|
public static <T> T readValue(String jsonString, Class<T> c) throws JsonException
T - the generic return typejsonString - the JSON stringc - the target class of the unmarshallingJsonException - if there is an error during unmarshallingpublic static <T> void writeValue(T o,
Class<T> c,
List<String> arrayProperties,
OutputStream os)
throws JsonException
OutputStream.T - the generic type of the objecto - the object to marshallc - the class of the object to be marshalledarrayProperties - the array propertiesos - the output streamJsonException - if there is an error during marshallingpublic static <T> void writeValue(T o,
OutputStream os)
throws JsonException
OutputStream.T - the type of the object to be marshalledo - the object to be marshalledos - the output streamJsonException - if there is an error during marshallingpublic static <T> String writeValueAsString(T o, Class<T> c, List<String> arrayProperties) throws JsonException
T - the generic type of the objecto - the object to be marshalledc - the class of the object to be marshalledarrayProperties - the array propertiesJsonException - if there is an error during marshallingpublic static <T> String writeValueAsString(T o, List<String> arrayProperties) throws JsonException
T - the generic type of the objecto - the object to be marshalledarrayProperties - the array propertiesJsonException - if there is an error during marshallingpublic static <T> String writeValueAsString(T o) throws JsonException
T - the generic type of the objecto - the object to be marshalledJsonException - if there is an error during marshallingCopyright © 2016 SAP. All Rights Reserved.