public class JSONParser
extends java.lang.Object
JSONValue
Modifier and Type | Field and Description |
---|---|
(package private) static JavaScriptObject |
typeMap |
Modifier and Type | Method and Description |
---|---|
static JSONValue |
parse(java.lang.String jsonString)
Deprecated.
|
static JSONValue |
parseLenient(java.lang.String jsonString)
Deprecated.
|
static JSONValue |
parseStrict(java.lang.String jsonString)
Evaluates a JSON string and returns its JSONValue representation.
|
(package private) static void |
throwJSONException(java.lang.String message) |
(package private) static void |
throwUnknownTypeException(java.lang.String typeString) |
static final JavaScriptObject typeMap
@Deprecated public static JSONValue parse(java.lang.String jsonString)
parseStrict(String)
eval()
function,
which can execute arbitrary script. DO NOT pass an untrusted string into
this method.
This method has been deprecated. Please call either
parseStrict(String)
(for inputs that strictly follow the JSON
specification) or parseLenient(String)
. The implementation of this
method calls parseLenient.
jsonString
- a JSON object to parsejava.lang.NullPointerException
- if jsonString
is
null
java.lang.IllegalArgumentException
- if jsonString
is empty@Deprecated public static JSONValue parseLenient(java.lang.String jsonString)
parseStrict(String)
eval()
function, which
can execute arbitrary script. DO NOT pass an untrusted string into this
method.jsonString
- a JSON object to parsejava.lang.NullPointerException
- if jsonString
is
null
java.lang.IllegalArgumentException
- if jsonString
is emptypublic static JSONValue parseStrict(java.lang.String jsonString)
JSON.parse function
is used.jsonString
- a JSON object to parsejava.lang.NullPointerException
- if jsonString
is null
java.lang.IllegalArgumentException
- if jsonString
is emptystatic void throwJSONException(java.lang.String message)
static void throwUnknownTypeException(java.lang.String typeString)