关于下面这段json 解析

酸奶瓶盖儿 发布于 2016/06/08 17:39
阅读 415
收藏 0
如下json格式,以最简单的方式放到实体类中。空项直接保存为“null”。
"items": [
            {
                "address": "上海上海市浦东新区莲园路100弄17号502",
                "id": "240",
                "mobile": "15721133670",
                "ord_id": "2016052600022",
                "name": "lbb",
                "email": "workspace_jing@hotmail.com",
                "ord_info": "外出服",
                "sn": "C20160530001",
                "duration": "",
                "dev_id": "C20160500021",
                "code": "001",
                "lnglat": "121.54829500000000000,31.18422300000000000",
                "flag": "1"
            },
            {
                "address": "上海上海市浦东新区莲园路100弄17号502",
                "id": "188",
                "mobile": "15721133670",
                "ord_id": "8089",
                "name": "lbb",
                "email": "workspace_jing@hotmail.com",
                "ord_info": "444444",
                "sn": "C20160400217",
                "duration": "540",
                "dev_id": "201602140001",
                "code": "001",
                "lnglat": "121.54829500000000000,31.18422300000000000",
                "flag": "1"
            },
            {
                "address": "上海上海市闵行区漕宝路",
                "id": "206",
                "mobile": "18018603916",
                "ord_id": "3535",
                "name": "让他天天",
                "email": "",
                "ord_info": "3535",
                "sn": "C20160500001",
                "dev_id": "3535",
                "code": "353",
                "lnglat": "121.34854400000000000,31.15501500000000000",
                "flag": "1"
            },
            {
                "address": "上海上海市奉贤区",
                "id": "100",
                "mobile": "18018603916",
                "ord_id": "5578",
                "name": "测试3",
                "email": "523805876@qq.com",
                "ord_info": "c111111",
                "sn": "C16022523",
                "duration": "",
                "dev_id": "21421425555",
                "code": "3",
                "lnglat": "121.47404200000000000,30.91779500000000000",
                "flag": "2"
            },
            {
                "id": "209",
                "ord_id": "45679",
                "ord_info": "455",
                "sn": "C20160500004",
                "dev_id": "",
                "lnglat": "",
                "flag": "1"
            }
        ]
加载中
0
彭云龙
彭云龙
用插件可以自动生成bean
0
aijiao
aijiao

引用来自“彭云龙”的评论

用插件可以自动生成bean
具体怎么实现呢?我是新手,望详解!
彭云龙
彭云龙
看看这个网站是不是你想要的。http://www.atool.org/json2javabean.php
0
放开那只肥鸡
放开那只肥鸡
先创建一个javabean,注意名字一定要一直,如果弄错了,反射的时候回报错。第二步,用json或者Gson转换一下就OK了。
0
is晓歌
is晓歌
写个对应的bean,用fastjson把那串json转化为对象就好了
返回顶部
顶部