阿里的fastJson.jar:

//list转换为json
List<CustPhone> list = new ArrayList<CustPhone>();
String str=JSON.toJSON(list).toString();
  • 1
  • 2
  • 3
//json转换为list
List<Person> list = new ArrayList<Person>();
list = JSONObject.parseArray(jasonArray, Person.class);
04-27 01:56