Represents a closure expression such as { statement } or { i -> statement } or { i, x, String y -> statement }
Fields inherited from class | Fields |
---|---|
class Expression |
EMPTY_ARRAY |
Type | Name and description |
---|---|
Statement |
code |
VariableScope |
variableScope |
Constructor and description |
---|
ClosureExpression
(Parameter[] parameters, Statement code) |
Type Params | Return Type | Name and description |
---|---|---|
|
Statement |
getCode() This gets the code statement of the closure. |
|
Parameter[] |
getParameters() |
|
String |
getText() |
|
VariableScope |
getVariableScope() |
|
boolean |
isParameterSpecified() |
|
void |
setCode(Statement code) This sets the code statement of the closure. |
|
void |
setVariableScope(VariableScope variableScope) |
|
String |
toString() |
|
Expression |
transformExpression(ExpressionTransformer transformer) |
|
void |
visit(GroovyCodeVisitor visitor) |
Methods inherited from class | Name |
---|---|
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, copyNodeMetaData, equals, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, getText, hashCode, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setNodeMetaData, setSourcePosition, visit |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
This gets the code statement of the closure. You can read this method to find out what actions the closure is going to perform.
This sets the code statement of the closure. You can use this method in order to add more actions during the closure execution.
code
- the new StatementCopyright © 2003-2018 The Apache Software Foundation. All rights reserved.