Package org.codehaus.groovy.ast
Interface Variable
- All Known Implementing Classes:
- DynamicVariable,- FieldNode,- Parameter,- PropertyNode,- VariableExpression
public interface Variable
interface to mark a AstNode as Variable. Typically these are
 VariableExpression, FieldNode, PropertyNode and Parameter
- 
Method SummaryModifier and TypeMethodDescriptionReturns the expression used to initialize the variable or null of there is no initialization.intgetName()Returns the name of the variable.Returns the type before wrapping primitives type of the variable.getType()Returns the type of the variable.booleanReturns true if there is an initialization expression.default booleanbooleandefault booleanisFinal()booleanReturns true if this variable is used in a static context.default booleandefault booleandefault booleanisPublic()default booleanisStatic()default booleandefault voidsetClosureSharedVariable(boolean inClosure) 
- 
Method Details- 
getNameString getName()Returns the name of the variable.
- 
getTypeClassNode getType()Returns the type of the variable.
- 
getOriginTypeClassNode getOriginType()Returns the type before wrapping primitives type of the variable.
- 
getInitialExpressionExpression getInitialExpression()Returns the expression used to initialize the variable or null of there is no initialization.
- 
hasInitialExpressionboolean hasInitialExpression()Returns true if there is an initialization expression.
- 
isInStaticContextboolean isInStaticContext()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
- 
isDynamicTypedboolean isDynamicTyped()
- 
getModifiersint getModifiers()
- 
isFinaldefault boolean isFinal()- Since:
- 5.0.0
 
- 
isPrivatedefault boolean isPrivate()- Since:
- 5.0.0
 
- 
isProtecteddefault boolean isProtected()- Since:
- 5.0.0
 
- 
isPublicdefault boolean isPublic()- Since:
- 5.0.0
 
- 
isStaticdefault boolean isStatic()- Since:
- 5.0.0
 
- 
isVolatiledefault boolean isVolatile()- Since:
- 5.0.0
 
 
-