|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.pmd.symboltable.DummyScope
Implementation of Scope for source types that are simpler than java sources. It implements the methods only when necessary not to break at runtime when Violations are handled.
| Constructor Summary | |
DummyScope()
|
|
| Method Summary | |
void |
addDeclaration(ClassNameDeclaration decl)
Add a class declaration to this scope |
void |
addDeclaration(MethodNameDeclaration decl)
Add a method declaration to this scope |
void |
addDeclaration(VariableNameDeclaration decl)
Add a variable declaration to this scope |
NameDeclaration |
addVariableNameOccurrence(NameOccurrence occ)
Adds a NameOccurrence to this scope - only call this after getting a true back from contains() |
boolean |
contains(NameOccurrence occ)
Tests whether or not a NameOccurrence is directly contained in the scope Note that this search is just for this scope - it doesn't go diving into any child scopes. |
java.util.Map |
getClassDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that exist at this scope |
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. |
MethodScope |
getEnclosingMethodScope()
Goes searching up the tree for this scope's enclosing SourceFileScope This is handy if you're buried down in a LocalScope and need to hop up to the MethodScope to find a method parameter. |
SourceFileScope |
getEnclosingSourceFileScope()
Goes searching up the tree for this scope's enclosing SourceFileScope This is handy if you're buried down in a LocalScope and need to hop up to the SourceFileScope to find a class name. |
Scope |
getParent()
Retrieves this scope's parent |
java.util.Map |
getVariableDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that exist at this scope |
void |
setParent(Scope parent)
Points this scope to its parent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DummyScope()
| Method Detail |
public java.util.Map getVariableDeclarations()
Scope
getVariableDeclarations in interface Scopepublic java.util.Map getClassDeclarations()
Scope
getClassDeclarations in interface Scopepublic void addDeclaration(ClassNameDeclaration decl)
Scope
addDeclaration in interface Scopepublic void addDeclaration(VariableNameDeclaration decl)
Scope
addDeclaration in interface Scopepublic void addDeclaration(MethodNameDeclaration decl)
Scope
addDeclaration in interface Scopepublic boolean contains(NameOccurrence occ)
Scope
contains in interface Scopepublic NameDeclaration addVariableNameOccurrence(NameOccurrence occ)
Scope
addVariableNameOccurrence in interface Scopepublic void setParent(Scope parent)
Scope
setParent in interface Scopepublic Scope getParent()
Scope
getParent in interface Scopepublic ClassScope getEnclosingClassScope()
Scope
getEnclosingClassScope in interface Scopepublic SourceFileScope getEnclosingSourceFileScope()
Scope
getEnclosingSourceFileScope in interface Scopepublic MethodScope getEnclosingMethodScope()
Scope
getEnclosingMethodScope in interface Scope
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||