-
- 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 aNavigateActionwhile navigating its branches.See package-info for more details
- Since:
- 15 June 2016
- Author:
- adoneitan@gmail.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidend()called after all navigation ends, and just before the navigation method exitsbooleanfailFast(String path, Exception e)called if navigation of a path throws an exceptionbooleanfailSilently(String path, Exception e)called if navigation of a path throws an exceptionvoidfoundLeafBeforePathEnd(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 sourcevoidhandleLeaf(TreePath tp, int arrIndex, Object arrItem)called when a leaf in a L is reached.voidhandleLeaf(TreePath tp, Object value)called when a leaf node is reached in a M.voidpathEnd(String path)called after the navigation of a path endsbooleanpathStart(String path)called before navigation of a new path startsvoidpathTailNotFound(TreePath tp, Object source)reached end of branch in source before end of specified path - the specified path does not exist in the sourcevoidrecurEnd(TreePath tp, L l)called when navigation of anNavigateActiontype object endsvoidrecurEnd(TreePath tp, M m)called when navigation of anNavigateActiontype object endsbooleanrecurInto(TreePath tp, L sourceNode)called when an array node is encountered on the pathbooleanrecurInto(TreePath tp, M sourceNode)called when an object node is encountered on the pathObjectresult()holds the result of the navigation, as assigned by the action implementing this interfacebooleanstart(M objectToNavigate, Collection<String> pathsToNavigate)called before any navigation of theNavigateActionstarts
-
-
-
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 theNavigateActionstarts- 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 anNavigateActiontype object ends- Parameters:
tp- the path pointing to the objectm- TODO
-
recurEnd
void recurEnd(TreePath tp, L l)
called when navigation of anNavigateActiontype 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
-
-