com.fasterxml.jackson.databind.ObjectMapper利用转换json到list

import com.fasterxml.jackson.databind.ObjectMapper;
private ObjectMapper objectMapper = new ObjectMapper();

 

private List<Student> changeListJsontoList(String content, Class classType) throws Exception {
        List<Student> Students = objectMapper.readValue(content, objectMapper.getTypeFactory().constructParametricType(ArrayList.class, classType));
        return Students;
}

 

 

 


版权声明:本文为wangyonglin1123原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。