Package net.minidev.json.actions.navigate

Navigate user-specified paths in a tree made up of Maps and List and process them

TreeNavigator only navigates through branches corresponding to user-specified paths. For each path, the navigation starts at the root and moves down the branch.

The TreeNavigator accepts a NavigateAction and provides callback hooks at each significant step which the NavigateAction may use to process the nodes.

A path to navigate must be specified in the n-gram format - a list of keys from the root down separated by dots: K0[[[[.K1].K2].K3]...]
A key to the right of a dot is a direct child of a key to the left of a dot. Keys with a dot in their name are not supported.

Sample usage:

 NavigateAction navAction = new NavigateAction(){...};
 JSONNavigator jsonNav = new JSONNavigator(navAction, "foo.bar.path");
 jsonNav.nav(new JSONObject(...));
 Object result = navAction.result();
 
Author:
[email protected]