标签:lis str stringbu keyset getjson stat param data ati
/**
*
* @param list
* @return _Json(单层);
* @throws Exception
*/
public static String getJson(List<Map<String,String>>list) throws Exception{
String data = "";
if(list != null){
data = "";
for(Map<String,String>map : list){
StringBuffer m = new StringBuffer();
m.append("{");
for(String key : map.keySet()){
m.append("\"" +key + "\":\""+map.get(key)+ "\",");
}
String subString = m.substring(0, m.length() -1)+"}";
data += subString + ",";
}
data = data.substring(0,data.length() - 1);
}else{
data = "";
}
return data;
}
拼接Josn 串(list存map)
标签:lis str stringbu keyset getjson stat param data ati
原文地址:http://www.cnblogs.com/dreammyone/p/6994668.html