如何将字符串转换为JSON对象以在JSNI中使用?
谢谢。
import com.google.gwt.core.client.JsonUtils;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
...
JSONObject data = new JSONObject(JsonUtils.safeEval(jsonString));
JSONArray array = data.get("anArray").isArray();
JSONObject obj = data.get("anObject").isObject();