json转换成list

json值:
String  jsonString = "[{"viewNameKey":"crm_customerName","viewNameContent":"客户姓名","viewNameValue":"crm_customerName","viewNameType":"view_bean","viewDate":"2014-1-14 14:13:51"},{"viewNameKey":"crm_vendTime","viewNameContent":"入库时间","viewNameValue":"crm_vendTime","viewNameType":"view_bean","viewDate":"2014-1-14 14:13:51"},{"viewNameKey":"crm_idnumberType","viewNameContent":"证件类型","viewNameValue":"crm_idnumberType","viewNameType":"view_bean","viewDate":"2014-1-14 14:13:51"},{"viewNameKey":"crm_idnumber","viewNameContent":"证件号码","viewNameValue":"crm_idnumber","viewNameType":"view_bean","viewDate":"2014-1-14 14:13:51"}]";
JSONArray ja = JSONArray.fromObject(jsonString);
Map<String, Class<ViewNameEntity>> classMap = new HashMap<String, Class<ViewNameEntity>>(); 
classMap.put("ViewNameEntity", ViewNameEntity.class); 
List<ViewNameEntity> viewNameList = JSONArray.toList(ja, ViewNameEntity.class, classMap);

你可能感兴趣的:(json)