List集合解析

发布于 2022-09-03 09:06:37 字数 1382 浏览 39 评论 0

[{"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...怎么解啊

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

简单爱 2022-09-10 09:06:37

安利一下我的开源项目 https://github.com/letcheng/E...

一世旳自豪 2022-09-10 09:06:37

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

〆一缕阳光ご 2022-09-10 09:06:37

List<Map<String,String>>

单调的奢华 2022-09-10 09:06:37
public class XXDTO {
    private String headSrc;
    private String id;
    private String imei1;
    private String imei2;
    private String jbname;
    private String jibie;
    private List<String> js = Collections.emptyList();
    private List<String> jsr = Collections.emptyList();
    private String miaoshu;
    private String mobeilUser;
    private String nickName;
    private String password;
    private String tel1;
    private String tel2;
    private String token;
    private String username;
    private String yg_bh;
    private String zhuangtai;
}

然后随便找一个json工具库把json字符串转成List<XXDTO>,例如jackson, fastjson等。

つ低調成傷 2022-09-10 09:06:37

把这个json字符串复制一下,然后用gson format插件自动生成bean

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文