public class SimpleTraverserContext<T> extends java.lang.Object implements TraverserContext<T>
Constructor and Description |
---|
SimpleTraverserContext(T node) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getInitialData()
Used to share something across all TraverserContext.
|
TraverserContext<T> |
getParentContext()
Returns parent context.
|
java.lang.Object |
getParentResult()
The result of the
TraverserContext.getParentContext() . |
java.lang.Object |
getResult()
The result of this TraverserContext..
|
<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)
Set the result for this TraverserContext.
|
<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 |
public SimpleTraverserContext(T node)
public T thisNode()
TraverserContext
thisNode
in interface TraverserContext<T>
public TraverserContext<T> getParentContext()
TraverserContext
TraverserContext.getParentContext()
links one could obtain
the current path as well as the variables TraverserContext.getVar(java.lang.Class)
stored in every parent context.getParentContext
in interface TraverserContext<T>
public java.lang.Object getParentResult()
TraverserContext
TraverserContext.getParentContext()
.getParentResult
in interface TraverserContext<T>
public boolean isVisited()
TraverserContext
isVisited
in interface TraverserContext<T>
true
if a node had been already visitedpublic java.util.Set<T> visitedNodes()
TraverserContext
TraverserVisitor.enter(graphql.util.TraverserContext)
methodvisitedNodes
in interface TraverserContext<T>
public <S> S getVar(java.lang.Class<? super S> key)
TraverserContext
getVar
in interface TraverserContext<T>
S
- type of the variablekey
- key to lookup the variable valuenull
public <S> TraverserContext<T> setVar(java.lang.Class<? super S> key, S value)
TraverserContext
setVar
in interface TraverserContext<T>
S
- type of a varablekey
- key to create bindings for the variablevalue
- value of variablepublic void setResult(java.lang.Object result)
TraverserContext
setResult
in interface TraverserContext<T>
public java.lang.Object getResult()
TraverserContext
getResult
in interface TraverserContext<T>
public java.lang.Object getInitialData()
TraverserContext
getInitialData
in interface TraverserContext<T>