I get the feeling that the answer might be a duplicate of this: Jackson - Json to POJO With Multiple Entries but I think that potentially the question is different enough. Also
You don't have to choose between Streaming (JsonParser
) and ObjectMapper
, do both!
Traverse a bit with parser, but then call JsonParser.readValueAs(MyType.class)
to bind individual JSON Object.
Or, call ObjectMapper
's readValue()
method passing JsonParser at appropriate points. Or use ObjectMapper.reader(Type.class).readValues()
and iterate that way.