See: Description
Interface | Description |
---|---|
JSONNavigateAction |
An interface for a processing action on the nodes of a
JSONObject while navigating its branches. |
NavigateAction<M extends Map<String,Object>,L extends List<Object>> |
An interface for a processing action on the nodes of a
M while navigating its branches. |
Class | Description |
---|---|
CopyPathsAction |
Creates a copy of a
JSONObject containing just the nodes on the paths specified. |
JSONNavigator | |
TreeNavigator<M extends Map<String,Object>,L extends List<Object>> |
Navigates only the branches of a
JSONObject corresponding to the paths specified. |
Map
s 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();
Copyright © 2020 Chemouni Uriel. All rights reserved.