public class ClosureListExpression
extends ListExpression
This class represents a list of expressions used to
create closures. Example:
def foo = (1;2;;)
The right side is a ClosureListExpression consisting of
two ConstantExpressions for the values 1 and 2, and two
EmptyStatement entries. The ClosureListExpression defines a new
variable scope. All created Closures share this scope.
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
ClosureListExpression(List<Expression> expressions)Builds a closure list from the supplied expressions and gives it a new VariableScope. |
ClosureListExpression()Builds an empty closure list with room for three expressions and a new VariableScope. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getText() |
|
public VariableScope |
getVariableScope()Returns the scope shared by the closures created from this list. |
|
public void |
setVariableScope(VariableScope scope)Replaces the scope shared by the closures created from this list. |
|
public Expression |
transformExpression(ExpressionTransformer transformer) |
|
public void |
visit(GroovyCodeVisitor visitor) |
| Methods inherited from class | Name |
|---|---|
class ListExpression |
addExpression, getExpression, getExpressions, getText, isWrapped, setWrapped, toString, transformExpression, visit |
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Builds a closure list from the supplied expressions and gives it a new VariableScope. Closures created from this list share that scope.
expressions - the expressions between the semicolons, in source orderBuilds an empty closure list with room for three expressions and a new VariableScope.
Returns the scope shared by the closures created from this list.
Replaces the scope shared by the closures created from this list.
scope - the scope those closures shareCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.