com.google.gwt.json.client

## Class JSONParser

- java.lang.Object
- - com.google.gwt.json.client.JSONParser

-     public class JSONParser
      extends java.lang.Object

  Parses the string representation of a JSON object into a set of JSONValue-derived objects.
  See Also:
    `JSONValue`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static JavaScriptObject` | `typeMap`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `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

    - #### typeMap

          static final JavaScriptObject typeMap

  - ### Method Detail

    - #### parse

          @Deprecated
          public static JSONValue parse(java.lang.String jsonString)

      Deprecated. use `parseStrict(String)` or `parseLenient(String)`
      Evaluates a trusted JSON string and returns its JSONValue representation. CAUTION! This method calls the JavaScript `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.

      Parameters:
        `jsonString` - a JSON object to parse
      Returns:
        a JSONValue that has been built by parsing the JSON string
      Throws:
        `java.lang.NullPointerException` - if `jsonString` is `null`
        `java.lang.IllegalArgumentException` - if `jsonString` is empty

    - #### parseLenient

          public static JSONValue parseLenient(java.lang.String jsonString)

      Evaluates a trusted JSON string and returns its JSONValue representation. CAUTION! This method calls the JavaScript `eval()` function, which can execute arbitrary script. DO NOT pass an untrusted string into this method.
      Parameters:
        `jsonString` - a JSON object to parse
      Returns:
        a JSONValue that has been built by parsing the JSON string
      Throws:
        `java.lang.NullPointerException` - if `jsonString` is `null`
        `java.lang.IllegalArgumentException` - if `jsonString` is empty

    - #### parseStrict

          public static JSONValue parseStrict(java.lang.String jsonString)

      Evaluates a JSON string and returns its JSONValue representation. The browser's `JSON.parse function` is used.
      Parameters:
        `jsonString` - a JSON object to parse
      Returns:
        a JSONValue that has been built by parsing the JSON string
      Throws:
        `java.lang.NullPointerException` - if `jsonString` is `null`
        `java.lang.IllegalArgumentException` - if `jsonString` is empty

    - #### throwJSONException

          static void throwJSONException(java.lang.String message)

    - #### throwUnknownTypeException

          static void throwUnknownTypeException(java.lang.String typeString)