List集合解析

[{"headSrc":"","id":"58d54506d7a242f9b6b84c0da800e26f","imei1":"","imei2":"","jbname":"","jibie":null,"js":[],"jsr":[],"miaoshu":"京九3","mobeilUser":null,"nickName":"","password":"123456","tel1":"","tel2":"","token":"","username":"京九3","yg_bh":"3","zhuangtai":"1"},{"headSrc":"","id":"c23c1542dac848958ece656093b0a30e","imei1":"","imei2":"","jbname":"","jibie":null,"js":[],"jsr":[],"miaoshu":"京九4","mobeilUser":null,"nickName":"","password":"123456","tel1":"","tel2":"","token":"","username":"京九4","yg_bh":"4","zhuangtai":"1"},{"headSrc":"","id":"f0cad11cdb5a46c881e384736880580f","imei1":"","imei2":"","jbname":"","jibie":null,"js":[],"jsr":[],"miaoshu":"京九5","mobeilUser":null,"nickName":"","password":"123456","tel1":"","tel2":"","token":"","username":"京九5","yg_bh":"5","zhuangtai":"1"},{"headSrc":"","id":"7efd1e21e71047a6a6587da0d93bbed5","imei1":"","imei2":"","jbname":"","jibie":null,"js":[],"jsr":[],"miaoshu":"京九6","mobeilUser":null,"nickName":"","password":"123456","tel1":"","tel2":"","token":"","username":"京九6","yg_bh":"6","zhuangtai":"1"},{"headSrc":"","id":"960a0c9889e048dcbac399bd0eb80f50","imei1":"","imei2":"","jbname":"","jibie":null,"js":[],"jsr":[],"miaoshu":"成东2","mobeilUser":null,"nickName":"","password":"123456","tel1":"","tel2":"","token":"","username":"成东2","yg_bh":"9","zhuangtai":"1"}]



这种集合怎么解析?先解析list,再解析每个list中的json...怎么解啊


HUX布斯
浏览 646回答 6
6回答

翻阅古今

感觉只能一层一层的剥了,碰到什么json类型,就创建相对应的,然后通过键来得到值。

九州编程

List<Map<String,String>>

FFIVE

public class XXDTO {&nbsp; &nbsp; private String headSrc;&nbsp; &nbsp; private String id;&nbsp; &nbsp; private String imei1;&nbsp; &nbsp; private String imei2;&nbsp; &nbsp; private String jbname;&nbsp; &nbsp; private String jibie;&nbsp; &nbsp; private List<String> js = Collections.emptyList();&nbsp; &nbsp; private List<String> jsr = Collections.emptyList();&nbsp; &nbsp; private String miaoshu;&nbsp; &nbsp; private String mobeilUser;&nbsp; &nbsp; private String nickName;&nbsp; &nbsp; private String password;&nbsp; &nbsp; private String tel1;&nbsp; &nbsp; private String tel2;&nbsp; &nbsp; private String token;&nbsp; &nbsp; private String username;&nbsp; &nbsp; private String yg_bh;&nbsp; &nbsp; private String zhuangtai;}然后随便找一个json工具库把json字符串转成List<XXDTO>,例如jackson, fastjson等。

眼眸繁星

把这个json字符串复制一下,然后用gson format插件自动生成bean
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java