import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.DeserializationFeature
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//JSON字符串
String jsonObj={"":""};
Student stu = mapper.readValue(jsonObj, Student.class);
//对象转JSON
JSON.toJSONString(stu);
参与评论
手机查看
返回顶部