首页 > 其他 > 详细

GSON

时间:2016-02-10 01:34:41      阅读:222      评论:0      收藏:0      [点我收藏+]
{
    "data": [
        {
            "children": [
                {
                    "id": 10007,
                    "title": "北京",
                    "type": 1,
                    "url": "/10007/list_1.json"
                },
                {
                    "id": 10006,
                    "title": "中国",
                    "type": 1,
                    "url": "/10006/list_1.json"
                },
                {
                    "id": 10008,
                    "title": "国际",
                    "type": 1,
                    "url": "/10008/list_1.json"
                },
                {
                    "id": 10010,
                    "title": "体育",
                    "type": 1,
                    "url": "/10010/list_1.json"
                },
                {
                    "id": 10091,
                    "title": "生活",
                    "type": 1,
                    "url": "/10091/list_1.json"
                },
                {
                    "id": 10012,
                    "title": "旅游",
                    "type": 1,
                    "url": "/10012/list_1.json"
                },
                {
                    "id": 10095,
                    "title": "科技",
                    "type": 1,
                    "url": "/10095/list_1.json"
                },
                {
                    "id": 10009,
                    "title": "军事",
                    "type": 1,
                    "url": "/10009/list_1.json"
                },
                {
                    "id": 10093,
                    "title": "时尚",
                    "type": 1,
                    "url": "/10093/list_1.json"
                },
                {
                    "id": 10011,
                    "title": "财经",
                    "type": 1,
                    "url": "/10011/list_1.json"
                },
                {
                    "id": 10094,
                    "title": "育儿",
                    "type": 1,
                    "url": "/10094/list_1.json"
                },
                {
                    "id": 10105,
                    "title": "汽车",
                    "type": 1,
                    "url": "/10105/list_1.json"
                }
            ],
            "id": 10000,
            "title": "新闻",
            "type": 1
        },
        {
            "id": 10002,
            "title": "专题",
            "type": 10,
            "url": "/10006/list_1.json",
            "url1": "/10007/list1_1.json"
        },
        {
            "id": 10003,
            "title": "组图",
            "type": 2,
            "url": "/10008/list_1.json"
        },
        {
            "dayurl": "",
            "excurl": "",
            "id": 10004,
            "title": "互动",
            "type": 3,
            "weekurl": ""
        }
    ],
    "extend": [
        10007,
        10006,
        10008,
        10014,
        10012,
        10091,
        10009,
        10010,
        10095
    ],
    "retcode": 200
}

JSON数据如上 现在用Gson对上面的复杂数据进行解析 先建立JAVABEAN对象 来封装:

1点了 我要睡觉了 明天更 想给大家说的很多 但我现在还很菜 所以只能发些很菜的东西希望可以帮到一些像我那时候一样迷茫的人

GSON

原文:http://www.cnblogs.com/AceIsSunshineRain/p/5185821.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!