public final class ForeachNode extends AbstractParentCommandNode<SoyNode> implements SoyNode.StandaloneNode, SoyNode.SplitLevelTopNode<SoyNode>, SoyNode.StatementNode, SoyNode.ExprHolderNode
Important: Do not use outside of Soy code (treat as superpackage-private).
SoyNode.BlockCommandNode, SoyNode.BlockNode, SoyNode.CommandNode, SoyNode.ConditionalBlockNode, SoyNode.ExprHolderNode, SoyNode.Kind, SoyNode.LocalVarBlockNode, SoyNode.LocalVarInlineNode, SoyNode.LocalVarNode, SoyNode.LoopNode, SoyNode.MsgBlockNode, SoyNode.MsgPlaceholderInitialNode, SoyNode.MsgSubstUnitNode, SoyNode.ParentSoyNode<N extends SoyNode>, SoyNode.RenderUnitNode, SoyNode.SplitLevelTopNode<N extends SoyNode>, SoyNode.StandaloneNode, SoyNode.StatementNodeSPACES| Constructor and Description |
|---|
ForeachNode(int id,
ExprRootNode<?> expr,
String commandText) |
| Modifier and Type | Method and Description |
|---|---|
ForeachNode |
clone()
Copies this node.
|
List<ExprUnion> |
getAllExprUnions()
Returns the list of expressions in this node.
|
ExprRootNode<?> |
getExpr()
Returns the parsed expression.
|
String |
getExprText()
Returns the text of the expression we're iterating over.
|
SoyNode.Kind |
getKind()
Returns this node's kind (corresponding to this node's specific type).
|
SoyNode.BlockNode |
getParent()
Gets this node's parent.
|
addChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChild, toSourceString, toTreeStringbuildTagStringHelper, buildTagStringHelper, getCommandName, getCommandText, getTagStringgetId, 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, replaceChildgetId, getSourceLocation, setId, setSourceLocationcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toSourceString, toTreeStringpublic ForeachNode(int id,
ExprRootNode<?> expr,
String commandText)
id - The id for this node.expr - The loop collection expressioncommandText - The command text.SoySyntaxException - If a syntax error is found.public SoyNode.Kind getKind()
SoyNodepublic String getExprText()
public ExprRootNode<?> getExpr()
public List<ExprUnion> getAllExprUnions()
SoyNode.ExprHolderNodegetAllExprUnions in interface SoyNode.ExprHolderNodepublic SoyNode.BlockNode getParent()
NodegetParent in interface NodegetParent in interface SoyNodegetParent in interface SoyNode.StandaloneNodegetParent in class AbstractSoyNodepublic ForeachNode 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.