1.fastjson List转JSONArray
List list = new ArrayList();
JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));
2.fastjson JSONArray转List
JSONArray array = new JSONArray();
List list = JSONObject.parseArray(array.toJSONString(), EventColAttr.class);
3.fastjson 字符串转List
String str = "";
List list = JSONObject.parseArray(str,T.class);
注意:如果类中有泛型,不可以直接转,需要从json中取出,放入确定的类中,再进行封装;
