public class ForStatement extends Statement implements LoopingStatement
Represents a for loop in Groovy.
| Modifiers | Name | Description | 
|---|---|---|
| static Parameter | FOR_LOOP_DUMMY | 
| Fields inherited from class | Fields | 
|---|---|
| interface Statement | CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, CLOSE_ALL_RESULTS, SUCCESS_NO_INFO, EXECUTE_FAILED, RETURN_GENERATED_KEYS, NO_GENERATED_KEYS | 
| Constructor and description | 
|---|
| ForStatement(Parameter indexVariable, Parameter valueVariable, Expression collectionExpression, Statement loopBlock)
 | 
| ForStatement(Parameter variable, Expression collectionExpression, Statement loopBlock) | 
| Type Params | Return Type | Name and description | 
|---|---|---|
|  | public Expression | getCollectionExpression() | 
|  | public Parameter | getIndexVariable()
 | 
|  | public Statement | getLoopBlock() | 
|  | public Parameter | getValueVariable()
 | 
|  | public Parameter | getVariable() | 
|  | public VariableScope | getVariableScope() | 
|  | public ClassNode | getVariableType() | 
|  | public void | setCollectionExpression(Expression collectionExpression) | 
|  | public void | setLoopBlock(Statement loopBlock) | 
|  | public void | setVariableScope(VariableScope scope) | 
|  | public void | visit(GroovyCodeVisitor visitor) | 
Copyright © 2003-2025 The Apache Software Foundation. All rights reserved.