-
- All Known Subinterfaces:
JSONNavigateAction
- All Known Implementing Classes:
CopyPathsAction
public interface NavigateAction<M extends Map<String,Object>,L extends List<Object>>
An interface for a processing action on the nodes of aNavigateAction
while navigating its branches.See package-info for more details
- Since:
- 15 June 2016
- Author:
- [email protected]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
end()
called after all navigation ends, and just before the navigation method exitsboolean
failFast(String path, Exception e)
called if navigation of a path throws an exceptionboolean
failSilently(String path, Exception e)
called if navigation of a path throws an exceptionvoid
foundLeafBeforePathEnd(TreePath jp, Object obj)
reached leaf node (not a container) in source but specified path expects children - the specified path does not exist in the sourcevoid
handleLeaf(TreePath tp, int arrIndex, Object arrItem)
called when a leaf in a L is reached.void
handleLeaf(TreePath tp, Object value)
called when a leaf node is reached in a M.void
pathEnd(String path)
called after the navigation of a path endsboolean
pathStart(String path)
called before navigation of a new path startsvoid
pathTailNotFound(TreePath tp, Object source)
reached end of branch in source before end of specified path - the specified path does not exist in the sourcevoid
recurEnd(TreePath tp, L l)
called when navigation of anNavigateAction
type object endsvoid
recurEnd(TreePath tp, M m)
called when navigation of anNavigateAction
type object endsboolean
recurInto(TreePath tp, L sourceNode)
called when an array node is encountered on the pathboolean
recurInto(TreePath tp, M sourceNode)
called when an object node is encountered on the pathObject
result()
holds the result of the navigation, as assigned by the action implementing this interfaceboolean
start(M objectToNavigate, Collection<String> pathsToNavigate)
called before any navigation of theNavigateAction
starts
-
-
-
Method Detail
-
pathStart
boolean pathStart(String path)
called before navigation of a new path starts- Parameters:
path
- TODO- Returns:
- true if the specified path should be navigated
-
start
boolean start(M objectToNavigate, Collection<String> pathsToNavigate)
called before any navigation of theNavigateAction
starts- Parameters:
objectToNavigate
- TODOpathsToNavigate
- TODO- Returns:
- true if navigation should start at all
-
pathTailNotFound
void pathTailNotFound(TreePath tp, Object source)
reached end of branch in source before end of specified path - the specified path does not exist in the source- Parameters:
tp
- TODOsource
- TODO
-
pathEnd
void pathEnd(String path)
called after the navigation of a path ends- Parameters:
path
- TODO
-
failSilently
boolean failSilently(String path, Exception e)
called if navigation of a path throws an exception- Parameters:
path
- TODOe
- TODO- Returns:
- true if the failure on this path should not abort the rest of the navigation
-
failFast
boolean failFast(String path, Exception e)
called if navigation of a path throws an exception- Parameters:
path
- TODOe
- TODO- Returns:
- true if the failure on this path should abort the rest of the navigation
-
recurInto
boolean recurInto(TreePath tp, M sourceNode)
called when an object node is encountered on the path- Parameters:
tp
- TODOsourceNode
- TODO- Returns:
- true if the navigator should navigate into the object
-
recurInto
boolean recurInto(TreePath tp, L sourceNode)
called when an array node is encountered on the path- Parameters:
tp
- TODOsourceNode
- TODO- Returns:
- true if the navigator should navigate into the array
-
foundLeafBeforePathEnd
void foundLeafBeforePathEnd(TreePath jp, Object obj)
reached leaf node (not a container) in source but specified path expects children - the specified path does not exist in the source- Parameters:
jp
- TODOobj
- TODO
-
handleLeaf
void handleLeaf(TreePath tp, Object value)
called when a leaf node is reached in a M. a leaf in a M is a key-value pair where the value is not a container itself (it is not a M nor a L)- Parameters:
tp
- - the JsonPath pointing to the leafvalue
- TODO
-
handleLeaf
void handleLeaf(TreePath tp, int arrIndex, Object arrItem)
called when a leaf in a L is reached. a leaf in a L is a non-container item (it is not a M nor a L)- Parameters:
tp
- -arrIndex
- -arrItem
- - the item
-
recurEnd
void recurEnd(TreePath tp, M m)
called when navigation of anNavigateAction
type object ends- Parameters:
tp
- the path pointing to the objectm
- TODO
-
recurEnd
void recurEnd(TreePath tp, L l)
called when navigation of anNavigateAction
type object ends- Parameters:
tp
- the path pointing to the objectl
- TODO
-
end
void end()
called after all navigation ends, and just before the navigation method exits
-
result
Object result()
holds the result of the navigation, as assigned by the action implementing this interface- Returns:
- - result
-
-