|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotatedNode
org.codehaus.groovy.ast.expr.Expression
org.codehaus.groovy.ast.expr.VariableExpression
public class VariableExpression
Represents a local variable name, the simplest form of expression. e.g. "foo".
Field Summary | |
---|---|
static VariableExpression |
SUPER_EXPRESSION
|
static VariableExpression |
THIS_EXPRESSION
|
Constructor Summary | |
---|---|
VariableExpression(String variable)
|
|
VariableExpression(String variable,
ClassNode type)
|
|
VariableExpression(Variable variable)
|
Method Summary | |
---|---|
Variable |
getAccessedVariable()
|
Expression |
getInitialExpression()
expression used to initialize the variable or null of there is no initialization. |
String |
getName()
the name of the variable |
ClassNode |
getOriginType()
the type before wrapping primitives type of the variable |
String |
getText()
|
ClassNode |
getType()
the type of the variable |
boolean |
hasInitialExpression()
returns true if there is an initialization expression |
boolean |
isClosureSharedVariable()
|
boolean |
isDynamicTyped()
|
boolean |
isInStaticContext()
returns true if this variable is used in a static context. |
boolean |
isSuperExpression()
|
boolean |
isThisExpression()
|
boolean |
isUseReferenceDirectly()
|
void |
setAccessedVariable(Variable origin)
|
void |
setClosureSharedVariable(boolean inClosure)
|
void |
setInStaticContext(boolean inStaticContext)
|
void |
setType(ClassNode cn)
|
void |
setUseReferenceDirectly(boolean useRef)
|
String |
toString()
|
Expression |
transformExpression(ExpressionTransformer transformer)
Return a copy of the expression calling the transformer on any nested expressions |
void |
visit(GroovyCodeVisitor visitor)
|
Methods inherited from class org.codehaus.groovy.ast.expr.Expression |
---|
transformExpressions, transformExpressions |
Methods inherited from class org.codehaus.groovy.ast.AnnotatedNode |
---|
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, isSynthetic, setDeclaringClass, setSynthetic |
Methods inherited from class org.codehaus.groovy.ast.ASTNode |
---|
getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setSourcePosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final VariableExpression THIS_EXPRESSION
public static final VariableExpression SUPER_EXPRESSION
Constructor Detail |
---|
public VariableExpression(String variable, ClassNode type)
public VariableExpression(String variable)
public VariableExpression(Variable variable)
Method Detail |
---|
public Variable getAccessedVariable()
public void setAccessedVariable(Variable origin)
public void visit(GroovyCodeVisitor visitor)
visit
in class ASTNode
public Expression transformExpression(ExpressionTransformer transformer)
Expression
transformExpression
in class Expression
public String getText()
getText
in class ASTNode
public String getName()
Variable
getName
in interface Variable
public String toString()
toString
in class Object
public Expression getInitialExpression()
Variable
getInitialExpression
in interface Variable
public boolean hasInitialExpression()
Variable
hasInitialExpression
in interface Variable
public boolean isInStaticContext()
Variable
isInStaticContext
in interface Variable
public void setInStaticContext(boolean inStaticContext)
public void setType(ClassNode cn)
setType
in class Expression
public boolean isDynamicTyped()
isDynamicTyped
in interface Variable
public boolean isClosureSharedVariable()
isClosureSharedVariable
in interface Variable
public void setClosureSharedVariable(boolean inClosure)
setClosureSharedVariable
in interface Variable
public void setUseReferenceDirectly(boolean useRef)
public boolean isUseReferenceDirectly()
public ClassNode getType()
Variable
getType
in interface Variable
getType
in class Expression
public ClassNode getOriginType()
Variable
getOriginType
in interface Variable
public boolean isThisExpression()
public boolean isSuperExpression()
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |