wanglingsong/JsonSurfer

Collector interface enhancement

wanglingsong opened this issue · 0 comments

Currently, the "collect" interfaces are not handy, because It surfs the whole json and apply only one JsonPath for each collection which is obviously not efficient at all. So I plan to add following interface:

    JsonSurfer surfer = JsonSurferJackson.INSTANCE;
    Builder builder = surfer.configBuilder();
    Holder holder1 = builder.collectOne("$.store");
    Holder holder2 = builder.collectAll("$.store.book[*]");
    builder.buildAndSurfer(json);
    holder1.get();
    holder2.get();

The enhanced interface will allow user to add any desired JsonPath during config building phase and collect everything matched into holders within a single surfing.