public class JSONTool extends Object
| Constructor and Description |
|---|
JSONTool() |
| Modifier and Type | Method and Description |
|---|---|
net.sf.json.JSON |
parse(String json)
Deprecated.
use
parseToJSONArray(String)} or parseToJSONObject(String) instead |
org.json.JSONArray |
parseToJSONArray(String json)
Parse a serialized JSON into a real JSONArray.
|
org.json.JSONObject |
parseToJSONObject(String json)
Parse a serialized JSON into a real JSONObject.
|
String |
serialize(Object object)
Serialize a Java object to the JSON format.
|
public String serialize(Object object)
Examples:
object - the object to be serialized to the JSON format@Deprecated public net.sf.json.JSON parse(String json)
parseToJSONArray(String)} or parseToJSONObject(String) insteadnull is returned.json - the string to parse, must be valid JSONJSONObject or a JSONArray, or
null if the argument is not a valid JSONpublic org.json.JSONObject parseToJSONObject(String json)
null is returned.json - the string to parse, must be valid JSONnull if the argument is not a valid JSONpublic org.json.JSONArray parseToJSONArray(String json)
null is returned.json - the string to parse, must be valid JSONnull if the argument is not a valid JSON arrayCopyright © 2011–2017 University of Toronto, Computational Biology Lab. All rights reserved.