|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.ast.VariableScope
public class VariableScope extends java.lang.Object
Represents a variable scope. This is primarily used to determine variable sharing across method and closure boundaries.
Constructor Summary | |
VariableScope()
|
|
VariableScope(VariableScope parent)
|
Method Summary | |
---|---|
VariableScope
|
copy()
|
ClassNode
|
getClassScope()
Non-null iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc. |
Variable
|
getDeclaredVariable(java.lang.String name)
|
VariableScope
|
getParent()
|
Variable
|
getReferencedClassVariable(java.lang.String name)
|
java.util.Map
|
getReferencedClassVariables()
Gets a map containing the class variables referenced by this scope. |
java.util.Iterator
|
getReferencedClassVariablesIterator()
Gets an iterator for the referenced class variables. |
Variable
|
getReferencedLocalVariable(java.lang.String name)
|
int
|
getReferencedLocalVariablesCount()
|
java.util.Iterator
|
getReferencedLocalVariablesIterator()
|
boolean
|
isClassScope()
Returns true iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc. |
boolean
|
isInStaticContext()
|
boolean
|
isReferencedClassVariable(java.lang.String name)
|
boolean
|
isReferencedLocalVariable(java.lang.String name)
|
boolean
|
isRoot()
|
void
|
putDeclaredVariable(Variable var)
|
void
|
putReferencedClassVariable(Variable var)
|
void
|
putReferencedLocalVariable(Variable var)
|
java.lang.Object
|
removeReferencedClassVariable(java.lang.String name)
|
void
|
setClassScope(ClassNode node)
|
void
|
setInStaticContext(boolean inStaticContext)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public VariableScope()
public VariableScope(VariableScope parent)
Method Detail |
---|
public VariableScope copy()
public ClassNode getClassScope()
public Variable getDeclaredVariable(java.lang.String name)
public VariableScope getParent()
public Variable getReferencedClassVariable(java.lang.String name)
public java.util.Map getReferencedClassVariables()
public java.util.Iterator getReferencedClassVariablesIterator()
public Variable getReferencedLocalVariable(java.lang.String name)
public int getReferencedLocalVariablesCount()
public java.util.Iterator getReferencedLocalVariablesIterator()
public boolean isClassScope()
public boolean isInStaticContext()
public boolean isReferencedClassVariable(java.lang.String name)
public boolean isReferencedLocalVariable(java.lang.String name)
public boolean isRoot()
public void putDeclaredVariable(Variable var)
public void putReferencedClassVariable(Variable var)
public void putReferencedLocalVariable(Variable var)
public java.lang.Object removeReferencedClassVariable(java.lang.String name)
public void setClassScope(ClassNode node)
public void setInStaticContext(boolean inStaticContext)
Groovy Documentation