invoke
public Object invoke(String currentPath,
PathRef parent,
Object model,
EvaluationContext ctx,
List<Parameter> parameters)
When we calculate the length of a path, what we're asking is given the node we land on how many children does it
have. Thus when we wrote the original query what we really wanted was $..book.length() or $.length($..book.*)
- Specified by:
invoke in interface PathFunction
- Parameters:
currentPath - The current path location inclusive of the function name
parent - The path location above the current function
model - The JSON model as input to this particular function
ctx - Eval context, state bag used as the path is traversed, maintains the result of executing
parameters -
- Returns: