public final class ForeachNonemptyNode extends AbstractBlockNode implements SoyNode.ConditionalBlockNode, SoyNode.LoopNode, SoyNode.LocalVarBlockNode
Important: Do not use outside of Soy code (treat as superpackage-private).
SPACES| Constructor and Description |
|---|
ForeachNonemptyNode(int id,
String varName) |
| Modifier and Type | Method and Description |
|---|---|
ForeachNonemptyNode |
clone()
Copies this node.
|
ExprRootNode<?> |
getExpr()
Returns the expression we're iterating over.
|
String |
getExprText()
Returns the text of the expression we're iterating over.
|
int |
getForeachNodeId() |
SoyNode.Kind |
getKind()
Returns this node's kind (corresponding to this node's specific type).
|
ForeachNode |
getParent()
Gets this node's parent.
|
LoopVar |
getVar() |
String |
getVarName()
Returns the name of this node's local variable (without the preceding '$').
|
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
addChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChild, toTreeStringgetId, getSourceLocation, setId, setSourceLocation, toStringcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParentequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChildcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toTreeStringpublic ForeachNonemptyNode(int id,
String varName)
id - The id for this node.varName - The variable name of the loop index variablepublic SoyNode.Kind getKind()
SoyNodepublic int getForeachNodeId()
public final LoopVar getVar()
public final String getVarName()
SoyNode.LocalVarNodegetVarName in interface SoyNode.LocalVarNodepublic String getExprText()
public ExprRootNode<?> getExpr()
public String toSourceString()
NodetoSourceString in interface Nodepublic ForeachNode getParent()
Nodepublic ForeachNonemptyNode clone()
NodeAll clone() overrides should follow this contract:
{@literal @}Override public T clone() {
return new T(this);
}
NOTE: this means we do not ultimately delegate to Object.clone(), ever.
TODO(lukes): The usecases for a clone method are few and far between. Making the AST nodes immutable (or at least unmodifiable) would be preferable to maintaining our clone() methods.