How to use Jackson to deserialise an array of objects

前端 未结 8 1288
梦谈多话
梦谈多话 2020-11-21 22:58

The Jackson data binding documentation indicates that Jackson supports deserialising \"Arrays of all supported types\" but I can\'t figure out the exact syntax for this.

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-21 23:04

    you could also create a class which extends ArrayList:

    public static class MyList extends ArrayList {}

    and then use it like:

    List list = objectMapper.readValue(json, MyList.class);
    

提交回复
热议问题