Json、String、Object转换

//List<Map<String, Object>>转字符串
String taxiJsonList = JSONArray.toJSONString(taxiExpendList);
//JSON字符串转换成Java对象,JSON字符串使用fastjson转实体用的的方法:import com.alibaba.fastjson.JSONObject;
Student student1 = JSONObject.parseObject(stuString, Student.class);
//List<Object[]>转字符串import java.util.Arrays;
Arrays.deepToString(proList.toArray())

//返回对象的字符串表示形式
JSON.stringify (myObject);

posted @ 2023-04-09 18:42  借你耳朵说爱你  阅读(28)  评论(0编辑  收藏  举报