1、maven依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.70</version>
</dependency>
2、JSON格式
{ "id":"UUID" "data":[ {"name":"zhangsan","sex":"1"}, {"name":"lisi","sex":"2"} ] }
3、解析(传入参数jsonObject)
Object id = jsonObject.get("id");
JSONArray jsonArray = jsonObject.getJSONArray("data");
LIst<UserBean> list= jsonArray.toJavaList(UserBean.class);