- All Known Subinterfaces:
JSONTraverseAction
- All Known Implementing Classes:
KeysPrintAction,LocatePathsJsonAction,RemoveElementsJsonAction,RemovePathsJsonAction,RetainPathsJsonAction
An interface for a processing action on the nodes of a
TreeTraverseAction tree
while traversing it. The order in which the callbacks are listed
below is the order in which they are called by the TreeTraverser
See package-info for more details
- Author:
- adoneitan@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidend()called after the traversal ends, and just before thestart(M)method exitsvoidhandleLeaf(String fullPathToContainingList, int listIndex, Object listItem) called for each leaf of an L list is encounteredvoidhandleLeaf(String fullPathToEntry, Map.Entry<String, Object> entry) called for each leaf of an M map is encounteredbooleancalled when a non-leaf item is encountered inside an L objectbooleancalled when a non-leaf entry is encountered inside an M objectbooleanremoveEntry(String fullPathToEntry, Map.Entry<String, Object> entry) the last callback for each entry in anTreeTraverseActionmap. if this method returns true theTreeTraverserremoves the entry from the map. there is no further handling of the entry.result()holds the result of the traversal, as assigned by the action implementing this interfacebooleancalled before any traversal of theTreeTraverseActiontree startsbooleantraverseEntry(String fullPathToEntry, Map.Entry<String, Object> entry) called when a new entry is encountered and before any processing is performed on it
-
Method Details
-
start
called before any traversal of theTreeTraverseActiontree starts- Parameters:
object- TODO- Returns:
- true if traversal should start at all
-
traverseEntry
-
removeEntry
the last callback for each entry in anTreeTraverseActionmap. if this method returns true theTreeTraverserremoves the entry from the map. there is no further handling of the entry.- Parameters:
fullPathToEntry- TODOentry- TODO- Returns:
- true if the entry and its subtree should be removed from the M tree
-
recurInto
-
recurInto
-
handleLeaf
-
handleLeaf
-
end
void end()called after the traversal ends, and just before thestart(M)method exits -
result
Object result()holds the result of the traversal, as assigned by the action implementing this interface- Returns:
- result
-