码迷,mamicode.com
首页 > 编程语言 > 详细

JSON转化为JAVABEAN集合

时间:2016-12-15 17:25:27      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:nbsp   result   class   jar   arch   row   ring   under   line   

String str = "[{‘id‘:‘392‘,‘type‘:‘jpg‘},{‘id‘:‘393‘,‘type‘:‘jpg‘},{‘id‘:‘377‘,‘type‘:‘jpg‘}]" ;

      JSONArray jArray=JSONArray. fromObject(str);

      List<UploadFile> list=JSONArray.toList (jArray ,UploadFile.class) ;

 

String  result = sendGetRequest(BaseEntity. SEARCH_URL + url);

      JSONObject json = JSONObject. fromObject(result);

      Integer status = json.getInt( "status");

      if(status == 0){

         totalPage = json .getInt("totalPage" );

         totalRows = json .getInt("totalRows" );

        JSONArray jsondata = json.getJSONArray("data");

         users = JSONArray.toList(jsondata, UserInfo.class );

JSON转化为JAVABEAN集合

标签:nbsp   result   class   jar   arch   row   ring   under   line   

原文地址:http://www.cnblogs.com/fengzhanfei/p/6183853.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!