我必須將具有POJO值的散列表轉換爲值。使用POJO將HashMap轉換爲JSON字符串值
HashMap<String,HashMap<String,VisualizerBean>> visualizerMap = new HashMap<String,HashMap<String,VisualizerBean>>();
JSONObject histoGramJsonData = new JSONObject(visualizerMap);
但我得到的JSON打印類名,
「(39.995,40.185]」:
{
"_type": "JavaClass",
"contentSum": null,
"count": null,
"_classname": "com.fractal.cascade.chart.didq.VariableVisualizerNodeModel$VisualizerBean",
"class": "com.fractal.cascade.chart.didq.VariableVisualizerNodeModel$VisualizerBean",
"contentMean": null
}
也許你需要使用Gson或Jackson? – chrylis