org.codehaus.groovy.ast.expr
Class DeclarationExpression
java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotatedNode
org.codehaus.groovy.ast.expr.Expression
org.codehaus.groovy.ast.expr.BinaryExpression
org.codehaus.groovy.ast.expr.DeclarationExpression
public class DeclarationExpression
extends BinaryExpression
Represents a local variable name declaration, an expression like
"def foo" or with type "String foo".
- Version:
- $Revision: 21304 $
- Author:
- Jochen Theodorou
Methods inherited from class org.codehaus.groovy.ast.ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition |
DeclarationExpression
public DeclarationExpression(VariableExpression left,
Token operation,
Expression right)
DeclarationExpression
public DeclarationExpression(Expression left,
Token operation,
Expression right)
visit
public void visit(GroovyCodeVisitor visitor)
- Overrides:
visit
in class BinaryExpression
getVariableExpression
public VariableExpression getVariableExpression()
setLeftExpression
public void setLeftExpression(Expression leftExpression)
- Overrides:
setLeftExpression
in class BinaryExpression
setRightExpression
public void setRightExpression(Expression rightExpression)
- Overrides:
setRightExpression
in class BinaryExpression
transformExpression
public Expression transformExpression(ExpressionTransformer transformer)
- Description copied from class:
Expression
- Return a copy of the expression calling the transformer on any nested expressions
- Overrides:
transformExpression
in class BinaryExpression
isMultipleAssignmentDeclaration
public boolean isMultipleAssignmentDeclaration()
- This method tells you if this declaration is a multiple assignment declaration, which
has the form "def (x, y) = ..." in Groovy. If this method returns true, then the left
hand side is an ArgumentListExpression. Do not call "getVariableExpression()" on this
object if this method returns true, instead use "getLeftExpression()".
- Returns:
- true if this declaration is a multiple assignment declaration, which means the
left hand side is an ArgumentListExpression.