T
- type of tree nodepublic interface TraverserContext<T>
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getInitialData() |
TraverserContext<T> |
getParentContext()
Returns parent context.
|
java.lang.Object |
getParentResult() |
java.lang.Object |
getResult() |
<S> S |
getVar(java.lang.Class<? super S> key)
Obtains a context local variable
|
boolean |
isVisited()
Informs that the current node has been already "visited"
|
void |
setResult(java.lang.Object result) |
<S> TraverserContext<T> |
setVar(java.lang.Class<? super S> key,
S value)
Stores a variable in the context
|
T |
thisNode()
Returns current node being visited
|
java.util.Set<T> |
visitedNodes()
Obtains all visited nodes and values received by the
TraverserVisitor.enter(graphql.util.TraverserContext)
method |
T thisNode()
TraverserContext<T> getParentContext()
getParentContext()
links one could obtain
the current path as well as the variables getVar(java.lang.Class)
stored in every parent context.
Useful when it is difficult to organize a local Visitor's stack, when performing
breadth-first or parallel traversaljava.lang.Object getParentResult()
boolean isVisited()
true
if a node had been already visitedjava.util.Set<T> visitedNodes()
TraverserVisitor.enter(graphql.util.TraverserContext)
method<S> S getVar(java.lang.Class<? super S> key)
S
- type of the variablekey
- key to lookup the variable valuenull
<S> TraverserContext<T> setVar(java.lang.Class<? super S> key, S value)
S
- type of a varablekey
- key to create bindings for the variablevalue
- value of variablevoid setResult(java.lang.Object result)
java.lang.Object getResult()
java.lang.Object getInitialData()