Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.6
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.ast.expr
[Java] 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".

Authors:
  Jochen Theodorou

Version:
  \$Revision: 21304 \$

Constructor Summary
`DeclarationExpression(VariableExpression left, Token operation, Expression right)`
`DeclarationExpression(Expression left, Token operation, Expression right)`

Method Summary
`VariableExpression` | `getVariableExpression()`
`boolean` | `isMultipleAssignmentDeclaration()` This method tells you if this declaration is a multiple assignment declaration, which has the form "def (x, y) = ..." in Groovy.
`void` | `setLeftExpression(Expression leftExpression)`
`void` | `setRightExpression(Expression rightExpression)`
`Expression` | `transformExpression(ExpressionTransformer transformer)`
`void` | `visit(GroovyCodeVisitor visitor)`

Methods inherited from class BinaryExpression
getLeftExpression, getOperation, getRightExpression, getText, newAssignmentExpression, newInitializationExpression, setLeftExpression, setRightExpression, toString, transformExpression, visit

Methods inherited from class Expression
getType, setType, transformExpression, transformExpressions, transformExpressions

Methods inherited from class AnnotatedNode
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic

Methods inherited from class ASTNode
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, getText, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Constructor Detail

### DeclarationExpression

    public DeclarationExpression(VariableExpression left, Token operation, Expression right)

### DeclarationExpression

    public DeclarationExpression(Expression left, Token operation, Expression right)

Method Detail

### getVariableExpression

    public VariableExpression getVariableExpression()

### 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.

### setLeftExpression

    public void setLeftExpression(Expression leftExpression)

### setRightExpression

    public void setRightExpression(Expression rightExpression)

### transformExpression

    public Expression transformExpression(ExpressionTransformer transformer)

### visit

    public void visit(GroovyCodeVisitor visitor)

Copyright © 2003-2010 The Codehaus. All rights reserved.