Deserialize JSON Array to Object with private list property using Jackson
问题 A JSON string like: [ "a", "b", "c" ] Would usually be deserialized to List<String> . But I have a class that looks like this: public class Foo { private List<String> theList; public Foo(List<String> theList) { this.theList = theList; } public String toString() { return new ObjectMapper().writeValueAsString(theList); } // ... more methods } Now I want to deserialize the above JSON string into an object of class Foo like: Foo foo = new ObjectMapper().readValue(jsonString, Foo.class); How is