我想要一个相当于的 json 对象
var data = {"nodes":"var postLoadData = {\n nodes:{408868239:{'tipo':'clase','shape':'dot','label':'clase2'},843594076:{'tipo':'clase','shape':'dot','label':'ESTADIA'}},edges:{\n 2:{408868239:{},843594076:{}}}};\n \n sys.graft(postLoadData);"}
我已经这样做了
JSONObject jsonObject = new JSONObject();
jsonObject.put("nodes", "var postLoadData = {\n nodes:{408868239:{'tipo':'clase','shape':'dot','label':'clase2'},843594076:{'tipo':'clase','shape':'dot','label':'ESTADIA'}}," +
"edges:{\n 2:{408868239:{},843594076:{}}}};\n \n sys.graft(postLoadData);");
我需要动态地向这个 json 对象添加边和节点。怎么做。