1,添加依赖
<!--json依赖-->
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
2,编写代码
/json转bean,data为需要转换的数据
JSONObject json = JSONObject.fromObject(Data);
Bean = (Bean) JSONObject.toBean(JSONObject.fromObject(json),Bean.class);
//转换成功,注意需要创建与json数据对应的对象bean