net.sourceforge.pmd.symboltable
Class ClassScope

java.lang.Object
  extended bynet.sourceforge.pmd.symboltable.AbstractScope
      extended bynet.sourceforge.pmd.symboltable.ClassScope
All Implemented Interfaces:
Scope

public class ClassScope
extends AbstractScope


Field Summary
private static int anonymousInnerClassCounter
           
private  java.lang.String className
           
 
Fields inherited from class net.sourceforge.pmd.symboltable.AbstractScope
methodNames, variableNames
 
Constructor Summary
ClassScope()
          This is only for anonymous inner classes FIXME - should have name like Foo$1, not Anonymous$1 to get this working right, the parent scope needs to be passed in when instantiating a ClassScope
ClassScope(java.lang.String className)
           
 
Method Summary
 void addDeclaration(MethodNameDeclaration decl)
          Add a method declaration to this scope
private  java.lang.String clipClassName(java.lang.String in)
           
protected  NameDeclaration findVariableHere(NameOccurrence occurrence)
           
 java.lang.String getClassName()
           
 ClassScope getEnclosingClassScope()
          Goes searching up the tree for this scope's enclosing ClassScope This is handy if you're buried down in a LocalScope and need to hop up to the ClassScope to find a method name.
 java.lang.String toString()
           
 
Methods inherited from class net.sourceforge.pmd.symboltable.AbstractScope
addDeclaration, addVariableNameOccurrence, contains, getParent, getVariableDeclarations, glomNames, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

anonymousInnerClassCounter

private static int anonymousInnerClassCounter

className

private java.lang.String className
Constructor Detail

ClassScope

public ClassScope(java.lang.String className)

ClassScope

public ClassScope()
This is only for anonymous inner classes FIXME - should have name like Foo$1, not Anonymous$1 to get this working right, the parent scope needs to be passed in when instantiating a ClassScope

Method Detail

getEnclosingClassScope

public ClassScope getEnclosingClassScope()
Description copied from interface: Scope
Goes searching up the tree for this scope's enclosing ClassScope This is handy if you're buried down in a LocalScope and need to hop up to the ClassScope to find a method name.

Specified by:
getEnclosingClassScope in interface Scope
Overrides:
getEnclosingClassScope in class AbstractScope

getClassName

public java.lang.String getClassName()

addDeclaration

public void addDeclaration(MethodNameDeclaration decl)
Description copied from interface: Scope
Add a method declaration to this scope

Specified by:
addDeclaration in interface Scope
Overrides:
addDeclaration in class AbstractScope

findVariableHere

protected NameDeclaration findVariableHere(NameOccurrence occurrence)
Specified by:
findVariableHere in class AbstractScope

toString

public java.lang.String toString()

clipClassName

private java.lang.String clipClassName(java.lang.String in)