我有一个 JSONObject
带有一些我想转换成 Map<String, Object>
的属性
有什么我可以从 json.org 或 ObjectMapper
使用的东西吗? ?
最佳答案
如果您发现使用 Jackson 有任何困难,可以使用 Gson() (com.google.gson) 库。
//按照 Martin Meeser 的建议将 yourJsonObject.toString() 更改为 yourJsonObject
HashMap<String, Object> yourHashMap = new Gson().fromJson(yourJsonObject, HashMap.class);
https://stackoverflow.com/questions/21544973/