type U stands for the continuation that following methods pass to themselves.
type U stands for the continuation that following methods pass to themselves.
Ideally it's just a closure that can implement getNext(curr: (T, U), tag: String, assoc: String): Iterable[(T, U)]
So options include
type U = List[MyWrapper] and type U = PartialFunction[(String, String), List[MyWrapper]] // basically getNext (tag, assoc)
The continuation is very good when getting the kids is expensive, like a DB query, eh?
prepare to start from a node, figure out the continuations.
prepare to start from a node, figure out the continuations.
This is only used to start, from the root - then getNext is used
You can return an actual list of nodes or a callback that you then call from getNext to get the actuals
the node we'll start resolving from
- optional the current path element - you can use cond to filter result set directly when querying
get the value of an attribute from the given node
get the value of an attribute from the given node
the value, toString, of the attribute
get the next list of nodes at the current position in the path.
get the next list of nodes at the current position in the path. For each, return a tuple with the respective value and the REST to continue solving
You can return an actual list of nodes or a callback that you then call from getNext to get the actuals
- optional the current path element - you can use cond to filter result set directly when querying
reduce the current set of possible nodes based on the given condition.
reduce the current set of possible nodes based on the given condition. Note that the condition may be null - this is still called to give you a chance to cleanup?
This default implementation may be ok for most resolvers
NOTE - if you choose to filter in getNext, then you don't have to filter here...
finally unwrap whatever and serve plain objects
finally unwrap whatever and serve plain objects
the node we'll start resolving from
this example resolves strings with the /x/y/z format