Tôi có một file Json trông như thế này:Làm thế nào để deserialize JSON tập tin bắt đầu với một mảng ở Jackson?
[
{ "field":"val" },
....
]
Tôi có đối tượng Java đại diện cho đối tượng duy nhất và bộ sưu tập của họ:
public class Objects{
public Collection<List> myObject;
}
Tôi muốn deserialize JSON sử dụng ObjectMapper
.
ObjectMapper mapper = new ObjectMapper();
mapper.readValue(in, Objects.class);
Nhưng tôi nhận được:
11-24 23:19:19.828: W/UpdateService(6084): org.codehaus.jackson.map.JsonMappingException:
Can not deserialize instance of com.project.my.Objects out of START_ARRAY token