N - A more specific subinterface of Node, or just Node if not applicable.R - The return type of this visitor.public abstract class AbstractReturningNodeVisitor<N extends Node,R> extends Object implements NodeVisitor<N,R>
AbstractXxxNodeVisitor classes.
Same as AbstractNodeVisitor except that in this class, internal visit() calls
return a value.
Important: Do not use outside of Soy code (treat as superpackage-private).
AbstractNodeVisitor| Constructor and Description |
|---|
AbstractReturningNodeVisitor() |
| Modifier and Type | Method and Description |
|---|---|
R |
exec(N node)
Executes the function defined by this visitor.
|
protected abstract R |
visit(N node)
Visits the given node to execute the function defined by this visitor.
|
protected List<R> |
visitChildren(ParentNode<? extends N> node)
Helper to visit all the children of a node, in order.
|
protected List<R> |
visitChildrenAllowingConcurrentModification(ParentNode<? extends N> node)
Helper to visit all the children of a node, in order.
|
public R exec(N node)
NodeVisitorexec in interface NodeVisitor<N extends Node,R>node - The node to execute the function on.protected abstract R visit(N node)
node - The node to visit.protected List<R> visitChildren(ParentNode<? extends N> node)
node - The parent node whose children to visit.visitChildrenAllowingConcurrentModification(com.google.template.soy.basetree.ParentNode<? extends N>)protected List<R> visitChildrenAllowingConcurrentModification(ParentNode<? extends N> node)
This method differs from visitChildren in that we are iterating through a copy of
the children. Thus, concurrent modification of the list of children is allowed.
node - The parent node whose children to visit.visitChildren(com.google.template.soy.basetree.ParentNode<? extends N>)