net.sourceforge.pmd.symboltable

Class ClassScope

public class ClassScope extends AbstractScope

BSD-style license; for more info see http://pmd.sourceforge.net/license.html
Field Summary
protected MapclassNames
protected MapmethodNames
protected MapvariableNames
Constructor Summary
ClassScope(String className)
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 Summary
voidaddDeclaration(VariableNameDeclaration variableDecl)
voidaddDeclaration(MethodNameDeclaration decl)
voidaddDeclaration(ClassNameDeclaration decl)
NameDeclarationaddVariableNameOccurrence(NameOccurrence occurrence)
protected NameDeclarationfindVariableHere(NameOccurrence occurrence)
MapgetClassDeclarations()
StringgetClassName()
ClassScopegetEnclosingClassScope()
MapgetMethodDeclarations()
MapgetVariableDeclarations()
StringtoString()

Field Detail

classNames

protected Map classNames

methodNames

protected Map methodNames

variableNames

protected Map variableNames

Constructor Detail

ClassScope

public ClassScope(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

addDeclaration

public void addDeclaration(VariableNameDeclaration variableDecl)

addDeclaration

public void addDeclaration(MethodNameDeclaration decl)

addDeclaration

public void addDeclaration(ClassNameDeclaration decl)

addVariableNameOccurrence

public NameDeclaration addVariableNameOccurrence(NameOccurrence occurrence)

findVariableHere

protected NameDeclaration findVariableHere(NameOccurrence occurrence)

getClassDeclarations

public Map getClassDeclarations()

getClassName

public String getClassName()

getEnclosingClassScope

public ClassScope getEnclosingClassScope()

getMethodDeclarations

public Map getMethodDeclarations()

getVariableDeclarations

public Map getVariableDeclarations()

toString

public String toString()