public class JSONValue
extends java.lang.Object
| Constructor and Description |
|---|
JSONValue() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
escape(java.lang.String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
|
static java.lang.Object |
parse(java.io.Reader in)
Deprecated.
this method may throw an
Error instead of returning
null; please use parseWithException(Reader)
instead |
static java.lang.Object |
parse(java.lang.String s)
Deprecated.
this method may throw an
Error instead of returning
null; please use parseWithException(String)
instead |
static java.lang.Object |
parseWithException(java.io.Reader in)
Parse JSON text into java object from the input source.
|
static java.lang.Object |
parseWithException(java.lang.String s)
description omitted.
|
static java.lang.String |
toJSONString(java.lang.Object value)
Convert an object to JSON text.
|
static void |
writeJSONString(java.lang.Object value,
java.io.Writer out)
Encode an object into JSON text and write it to out.
|
@Deprecated public static java.lang.Object parse(java.io.Reader in)
Error instead of returning
null; please use parseWithException(Reader)
insteadin - description omitted.JSONParser.parse(Reader),
parseWithException(Reader)@Deprecated public static java.lang.Object parse(java.lang.String s)
Error instead of returning
null; please use parseWithException(String)
insteads - description omitted.JSONParser.parse(Reader),
parseWithException(Reader)public static java.lang.Object parseWithException(java.io.Reader in)
throws java.io.IOException,
ParseException
in - description omitted.java.io.IOException - description omitted.ParseException - description omitted.JSONParserpublic static java.lang.Object parseWithException(java.lang.String s)
throws ParseException
s - description omitted.ParseException - description omitted.public static void writeJSONString(java.lang.Object value,
java.io.Writer out)
throws java.io.IOException
If this object is a Map or a List, and it's also a JSONStreamAware or a JSONAware, JSONStreamAware or JSONAware will be considered firstly.
DO NOT call this method from writeJSONString(Writer) of a class that implements both JSONStreamAware and (Map or List) with "this" as the first parameter, use JSONObject.writeJSONString(Map, Writer) or JSONArray.writeJSONString(List, Writer) instead.
value - description omitted.out - description omitted.java.io.IOException - description omitted.JSONObject.writeJSONString(Map, Writer),
JSONArray.writeJSONString(Collection, Writer)public static java.lang.String toJSONString(java.lang.Object value)
If this object is a Map or a List, and it's also a JSONAware, JSONAware will be considered firstly.
DO NOT call this method from toJSONString() of a class that implements both JSONAware and Map or List with "this" as the parameter, use JSONObject.toJSONString(Map) or JSONArray.toJSONString(List) instead.
value - description omitted.JSONObject.toJSONString(Map),
JSONArray.toJSONString(Collection)public static java.lang.String escape(java.lang.String s)
s - description omitted.