|
GWT 2.6.0-rc4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.json.client.JSONParser
public class JSONParser
Parses the string representation of a JSON object into a set of JSONValue-derived objects.
JSONValue
Field Summary | |
---|---|
(package private) static JavaScriptObject |
typeMap
|
Method Summary | |
---|---|
static JSONValue |
parse(java.lang.String jsonString)
Deprecated. use parseStrict(String) or
parseLenient(String) |
static JSONValue |
parseLenient(java.lang.String jsonString)
Evaluates a trusted JSON string and returns its JSONValue representation. |
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final JavaScriptObject typeMap
Method Detail |
---|
@Deprecated public static JSONValue parse(java.lang.String jsonString)
parseStrict(String)
or
parseLenient(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 parse
java.lang.NullPointerException
- if jsonString
is
null
java.lang.IllegalArgumentException
- if jsonString
is emptypublic static JSONValue parseLenient(java.lang.String jsonString)
eval()
function, which
can execute arbitrary script. DO NOT pass an untrusted string into this
method.
jsonString
- a JSON object to parse
java.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. For older
browsers including IE6 and IE7 that lack a JSON.parse
function, the
input is validated as described in RFC 4627 for safety and passed to
eval()
.
jsonString
- a JSON object to parse
java.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)
|
GWT 2.6.0-rc4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |