DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY-它应该为您工作。
例:
final String json = "{"date" : "2013-05-11","value" : 123}";final ObjectMapper mapper = new ObjectMapper() .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);final List<Point> points = mapper.readValue(json, new TypeReference<List<Point>>() {});
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)