我想在每个KPI值上加上逻辑。所以,我在哪里找到了" KPI"我会把它放在strKey中,就像在下面我想要放置"指令"在第一次迭代和第二次迭代中"过程"。张贴实现一些逻辑。
{
"kpis": [
{
"KPI":"Directs",
"definition":{
"type":{
"exec":"aggregate"
},
"result":{
"columns":[
"Month",
"Last Touch Marketing Channel"
]
}
}
},
{
"KPI":"Process",
"definition":{
"type":{
"exec":"aggregate"
},
"result":{
"columns":[
"Month",
"Last Touch Marketing Channel"
]
}
}
}
]
}
javacode
JSONTokener objJSONTokener = new JSONTokener(objFileReader);
JSONObject objJSONRoot = (JSONObject) objJSONTokener.nextValue();
JSONObject objElement;
JSONObject thisDefinition;
String strKey;
java.util.Iterator<String> objDictionary = objJSONRoot.keys();
while (objDictionary.hasNext()) {
strKey = objDictionary.next();
//to do..
}