使用com.alibaba.fastjson.JSONArray的JSONArray.parseArray()方法解析字符串或list

1.fastjson的JSONArray   将List转换为JSONArray   T为实体类
List<T> list = new ArrayList<T>();
JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));


2.fastjson的JSONArray   JSONArray转List   EventColAttr为实体类
JSONArray array = new JSONArray();
List<EventColAttr> list = JSONObject.parseArray(array.toJSONString(), EventColAttr.class);


3.fastjson的JSONArray   字符串转List   T为实体类
String str = ""; 或 String str = "[{T},{T}]"
List<T> list = JSONObject.parseArray(str,T.class);