public class JSONTool extends Object
Constructor and Description |
---|
JSONTool() |
Modifier and Type | Method and Description |
---|---|
Object |
fromString(String str)
|
net.sf.json.JSON |
parse(String json)
Deprecated.
since 9.9RC1, use
fromString(String) instead |
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 formatpublic Object fromString(String str)
str
- the string to parseObject
resolved from the string (usually a Maps or and Lists)@Deprecated public net.sf.json.JSON parse(String json)
fromString(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 JSONCopyright © 2004–2019 XWiki. All rights reserved.