You are using JSONObject
JSONVAlue
and JSONArray
whose toString()
method should give you a well formed json representation of your object.
See :
http://www.gwtproject.org/javadoc/latest/com/google/gwt/json/client/JSONObject.html#toString()
http://www.gwtproject.org/javadoc/latest/com/google/gwt/json/client/JSONValue.html#toString()
http://www.gwtproject.org/javadoc/latest/com/google/gwt/json/client/JSONArray.html#toString()