这是非常简单的但是很难实现.帮我解决这个问题.
我有一个json数据{"abc":"test","bed":"cot","help":"me"}
我想将上面的jsonObject转换为JSON ARRAY,如[{"abc":"test","bed":"cot","help":"me"}]
JSONObject obj= new JSONObject(str.toString());
Iterator x = obj.keys();
JSONArray jsonArray = new JSONArray();
Map<String, String> map = new HashMap<String, String>();
while (x.hasNext()) {
  for(int i=0;i<obj.length();i++) {
    LOG.info("=============");
    String key = (String) x.next();
    jsonArray.put(obj.get(key));
  }
}
Run Code Online (Sandbox Code Playgroud)
我只得到价值观.请帮我解决这个问题.
我必须将数组块与 Angularjs 中的对象数组合并为单个数组。
我的输入数组将是这样的:
[
  [
    {
      "title": "asd",
      "description": "asd"
    },
    {
      "title": "asz",
      "description": "sd"
    }
  ],
  [
    {
      "title": "ws",
      "description": "sd"
    },
    {
      "title": "re",
      "description": "sd"
    }
  ],
  [
    {
      "title": "32",
      "description": "xxs"
    },
    {
      "title": "xxc",
      "description": "11"
    }
  ]
]
Run Code Online (Sandbox Code Playgroud)
上面的输入数组应该像下面的对象数组一样保存
[
  {
    "title": "asd",
    "description": "asd"
  },
  {
    "title": "asz",
    "description": "sd"
  },
  {
    "title": "ws",
    "description": "sd"
  },
  {
    "title": "re",
    "description": "sd"
  },
  {
    "title": "32",
    "description": "xxs"
  }, …Run Code Online (Sandbox Code Playgroud)