【发布时间】:2013-11-09 01:46:34
【问题描述】:
我正在尝试将 Json 数组反序列化为对象的 ArrayList。我找到了一些关于我正在尝试做的事情的文档,但是我在编译时遇到了错误。
这是我尝试使用 Jackson 2.2.2 的方法:
ArrayList<Friends> list = objectMapper.readValue(result, new TypeReference<ArrayList<Friends>>() {});
我得到的错误是:
The method readValue(String, Class<T>) in the type ObjectMapper is not applicable for the arguments (String, new TypeReference<ArrayList<Friends>>(){})
我猜我一直在阅读的一些参考资料是基于 Jackson 的旧版本。如何在 Jackson 2.2 + 中实现这一点
【问题讨论】: