com.extjs.gxt.ui.client.js
Class JsonConverter

java.lang.Object
  extended by com.extjs.gxt.ui.client.js.JsonConverter

public class JsonConverter
extends java.lang.Object

Helper class to decode and encode objects to and from Json. Converter handles simple data types (strings, numbers, booleans) and lists and maps.


Constructor Summary
JsonConverter()
           
 
Method Summary
static java.util.Map<java.lang.String,java.lang.Object> decode(com.google.gwt.json.client.JSONObject jso)
          Decodes a JSONObject to a map.
static java.util.Map<java.lang.String,java.lang.Object> decode(java.lang.String jsonString)
          Decodes a Json string into a map.
static com.google.gwt.json.client.JSONObject encode(java.util.Map<java.lang.String,java.lang.Object> map)
          Encodes a map into a JSONObject.
static com.google.gwt.json.client.JSONObject encode(ModelData model)
          Encodes a model data instance into a JSONObject.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonConverter

public JsonConverter()
Method Detail

decode

public static java.util.Map<java.lang.String,java.lang.Object> decode(java.lang.String jsonString)
Decodes a Json string into a map.

Parameters:
jsonString - the Json string
Returns:
the map

decode

public static java.util.Map<java.lang.String,java.lang.Object> decode(com.google.gwt.json.client.JSONObject jso)
Decodes a JSONObject to a map.

Parameters:
jso - the JSONObject
Returns:
the map

encode

public static com.google.gwt.json.client.JSONObject encode(java.util.Map<java.lang.String,java.lang.Object> map)
Encodes a map into a JSONObject.

Parameters:
map - the map
Returns:
the JSONObject

encode

public static com.google.gwt.json.client.JSONObject encode(ModelData model)
Encodes a model data instance into a JSONObject.

Parameters:
model - the model data object
Returns:
the JSONObject