com.google.gwt.core.client
Class JsonUtils

java.lang.Object
  extended by com.google.gwt.core.client.JsonUtils

public class JsonUtils
extends java.lang.Object

Provides JSON-related utility methods.


Method Summary
static java.lang.String escapeValue(java.lang.String toEscape)
          Returns a quoted, escaped JSON String.
static
<T extends JavaScriptObject>
T
unsafeEval(java.lang.String json)
          Evaluates a JSON expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

escapeValue

public static java.lang.String escapeValue(java.lang.String toEscape)
Returns a quoted, escaped JSON String.


unsafeEval

public static <T extends JavaScriptObject> T unsafeEval(java.lang.String json)
Evaluates a JSON expression. This method does not validate the JSON text and should only be used on JSON from trusted sources.

Type Parameters:
T - The type of JavaScriptObject that should be returned
Parameters:
json - The source JSON text
Returns:
The evaluated object