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

web service json 数组解析

时间:2014-12-15 12:15:57      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:style   ar   sp   for   on   div   art   bs   ad   


    boolean workexpMark = true;
    // 美发师工作经历json数组解析
    org.json.JSONObject jsonObject = new org.json.JSONObject(
      workExperience);
 
    String array = jsonObject.getString("workExperence");
 
    org.json.JSONArray jsonArray = new org.json.JSONArray(array);
    
    int ja = jsonArray.length();
    String workExperienceIds="";
    for (int i = 0; i < ja; i++) {
     WorkExperience workExperienceBean = new WorkExperience();
     
     org.json.JSONObject object = jsonArray.getJSONObject(i);
     
     workExperienceBean.setContent(object.getString("content"));
     workExperienceBean.setDelStatus(false);
     workExperienceBean.setEndTime(object.getString("endTime"));
     workExperienceBean.setStartTime(object.getString("startTime"));
     workExperienceBean.setUpdateTime(updatetime);
 
     // 添加工作经历
     int workExperienceId=workExperienceService.addWorkExperience(workExperienceBean);
     if ( workExperienceId> 0) {
      workExperienceIds=workExperienceIds+workExperienceId+";";
     } else {
      workexpMark = false;
      map.put("success", 0);
     }
    }

web service json 数组解析

标签:style   ar   sp   for   on   div   art   bs   ad   

原文地址:http://blog.csdn.net/jiao_zg/article/details/41941025

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