jackson把json转换成LIst

把json数据转换成list

ObjectMapper mapper = new ObjectMapper();
  List<YeWuLuYou> readValue = mapper.readValue(yeWuLuYou,new TypeReference<List<YeWuLuYou>>(){});

 

把数据转换成json

 String json=mapper.writeValueAsString(object);
  return json;

posted @ 2019-01-03 16:45  代码界的绵绵雨  阅读(3778)  评论(0编辑  收藏  举报