import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.DeserializationFeature;
public class Test {
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);
}