{"top_source_list":"{\"100\":[{\"2017-12-11 \":\"2807\"}]},{\"104\":[{\"2017-12-11 \":\"1269\"}]},{\"303\":[{\"2017-12-06 \":\"218\"}]}"}
通过getKey("top_source_list")可获得下面的结果:
{\"100\":[{\"2017-12-11 \":\"2807\"}]},{\"104\":[{\"2017-12-11 \":\"1269\"}]},{\"303\":[{\"2017-12-06 \":\"218\"}]}
现在想获取3个值,第一个例如:\"100\"中的100,第二个值例如日期:2017-12-11,第三个值:2807.以此获取相应的全部值。
/**
Created by hp.he on 2017/12/12.
*/
public class MainClass {
public static void main(String args[]) {
String str = "{\"top_source_list\":\"{\\"100\\":[{\\"2017-12-11 \\":\\"2807\\"}]},{\\"104\\":[{\\"2017-12-11 \\":\\"1269\\"}]},{\\"303\\":[{\\"2017-12-06 \\":\\"218\\"}]}\"}";
Map map = JsonUtil.json2Map(str);
System.out.println(map);
}
static class InnerObject{
Integer key;
ArrayList arrayList;
}
static class InnerInnerObject{
String date;
Integer key;
}
}
希望解答被采纳。