org.codehaus.groovy.ast.expr
Class VariableExpression
java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.expr.Expression
org.codehaus.groovy.ast.expr.VariableExpression
- All Implemented Interfaces:
- Variable
- public class VariableExpression
- extends Expression
- implements Variable
Represents a local variable name, the simplest form of expression. e.g. "foo".
- Version:
- $Revision: 1.13 $
- Author:
- James Strachan
THIS_EXPRESSION
public static final VariableExpression THIS_EXPRESSION
SUPER_EXPRESSION
public static final VariableExpression SUPER_EXPRESSION
VariableExpression
public VariableExpression(String variable,
ClassNode type)
VariableExpression
public VariableExpression(String variable)
visit
public void visit(GroovyCodeVisitor visitor)
- Overrides:
visit
in class ASTNode
transformExpression
public Expression transformExpression(ExpressionTransformer transformer)
- Description copied from class:
Expression
- Return a copy of the expression calling the transformer on any nested expressions
- Specified by:
transformExpression
in class Expression
- Parameters:
transformer
-
- Returns:
getText
public String getText()
- Overrides:
getText
in class ASTNode
getName
public String getName()
- Description copied from interface:
Variable
- the name of the variable
- Specified by:
getName
in interface Variable
toString
public String toString()
- Returns:
- true if this variable is dynamically typed
getInitialExpression
public Expression getInitialExpression()
- Description copied from interface:
Variable
- expression used to initialize the variable or null of there
is no initialization.
- Specified by:
getInitialExpression
in interface Variable
hasInitialExpression
public boolean hasInitialExpression()
- Description copied from interface:
Variable
- returns true if there is an initialization expression
- Specified by:
hasInitialExpression
in interface Variable
isInStaticContext
public boolean isInStaticContext()
- Description copied from interface:
Variable
- returns true if this variable is used in a static context.
A static context is any static initializer block, when this variable
is declared as static or when this variable is used in a static method
- Specified by:
isInStaticContext
in interface Variable
setInStaticContext
public void setInStaticContext(boolean inStaticContext)
setType
public void setType(ClassNode cn)
- Overrides:
setType
in class Expression
isDynamicTyped
public boolean isDynamicTyped()
- Specified by:
isDynamicTyped
in interface Variable
Copyright © 2003-2007 The Codehaus. All Rights Reserved.