public interface JSONParser
T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Modifier and Type | Method and Description |
---|---|
<T> T |
fromJson(byte[] json,
Class<T> classOfT)
Deserialize JSON data to a Java object.
|
<T> T |
fromJson(CharSequence json,
Class<T> classOfT)
Deserialize JSON data to a Java object.
|
String |
toFormattedJson(Object src)
Serialize a Java object to a nicely formatted JSON suitable for human
reading.
|
String |
toJson(Object src)
Serialize a Java object to JSON.
|
<T> T fromJson(CharSequence json, Class<T> classOfT) throws IOException
T
- the Java object containing fields corresponding to the JSON
data.json
- the JSON object.classOfT
- class of the Java object.IOException
- on a parsing error.<T> T fromJson(byte[] json, Class<T> classOfT) throws IOException
T
- the Java object containing fields corresponding to the JSON
data.json
- the JSON object in form of a byte array.classOfT
- class of the Java object.IOException
- on a parsing error.String toJson(Object src)
src
- a Java object to serialize.