Groovy 1.7.0

## org.codehaus.groovy.ast
Class VariableScope

    java.lang.Object
      org.codehaus.groovy.ast.VariableScope

    class VariableScope
    extends Object

Represents a variable scope. This is primarily used to determine variable sharing across method and closure boundaries.

author:
  James Strachan

author:
  Jochen Theodorou

version:
  $Revision: 17917 $

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(String name)`
`VariableScope` | `getParent()`
`Variable` | `getReferencedClassVariable(String name)`
`Map` | `getReferencedClassVariables()` Gets a map containing the class variables referenced by this scope.
`Iterator` | `getReferencedClassVariablesIterator()` Gets an iterator for the referenced class variables.
`Variable` | `getReferencedLocalVariable(String name)`
`int` | `getReferencedLocalVariablesCount()`
`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(String name)`
`boolean` | `isReferencedLocalVariable(String name)`
`boolean` | `isResolvingDynamic()`
`boolean` | `isRoot()`
`void` | `putDeclaredVariable(Variable var)`
`void` | `putReferencedClassVariable(Variable var)`
`void` | `putReferencedLocalVariable(Variable var)`
`Object` | `removeReferencedClassVariable(String name)`
`void` | `setClassScope(ClassNode node)`
`void` | `setDynamicResolving(boolean resolvesDynamic)`
`void` | `setInStaticContext(boolean inStaticContext)`

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

Constructor Detail

### VariableScope

    public VariableScope()

### VariableScope

    public VariableScope(VariableScope parent)

Method Detail

### copy

    public VariableScope copy()

### getClassScope

    public ClassNode getClassScope()

  Non-null iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.

### getDeclaredVariable

    public Variable getDeclaredVariable(String name)

### getParent

    public VariableScope getParent()

### getReferencedClassVariable

    public Variable getReferencedClassVariable(String name)

### getReferencedClassVariables

    public Map getReferencedClassVariables()

  Gets a map containing the class variables referenced by this scope. This not can not be modified.
  return:
    a map containing the class variable references

### getReferencedClassVariablesIterator

    public Iterator getReferencedClassVariablesIterator()

  Gets an iterator for the referenced class variables. The remove operation is not supported.
  return:
    an iterator for the referenced class variables

### getReferencedLocalVariable

    public Variable getReferencedLocalVariable(String name)

### getReferencedLocalVariablesCount

    public int getReferencedLocalVariablesCount()

### getReferencedLocalVariablesIterator

    public Iterator getReferencedLocalVariablesIterator()

### isClassScope

    public boolean isClassScope()

  Returns true iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.

### isInStaticContext

    public boolean isInStaticContext()

### isReferencedClassVariable

    public boolean isReferencedClassVariable(String name)

### isReferencedLocalVariable

    public boolean isReferencedLocalVariable(String name)

### isResolvingDynamic

    @Deprecated
    public boolean isResolvingDynamic()

### isRoot

    public boolean isRoot()

### putDeclaredVariable

    public void putDeclaredVariable(Variable var)

### putReferencedClassVariable

    public void putReferencedClassVariable(Variable var)

### putReferencedLocalVariable

    public void putReferencedLocalVariable(Variable var)

### removeReferencedClassVariable

    public Object removeReferencedClassVariable(String name)

### setClassScope

    public void setClassScope(ClassNode node)

### setDynamicResolving

    @Deprecated
    public void setDynamicResolving(boolean resolvesDynamic)

### setInStaticContext

    public void setInStaticContext(boolean inStaticContext)

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