net.sourceforge.pmd.lang.java.symboltable
Class AbstractJavaScope
java.lang.Object
net.sourceforge.pmd.lang.symboltable.AbstractScope
net.sourceforge.pmd.lang.java.symboltable.AbstractJavaScope
- All Implemented Interfaces:
- Scope
- Direct Known Subclasses:
- ClassScope, LocalScope, MethodScope, SourceFileScope
public abstract class AbstractJavaScope
- extends AbstractScope
Provides the basic java scope implementation
- See Also:
- JLS 6.3
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractJavaScope
public AbstractJavaScope()
addDeclaration
public void addDeclaration(NameDeclaration declaration)
- Description copied from interface:
Scope
- Adds a new declaration to this scope. Only after the declaration has been added,
Scope.contains(NameOccurrence)
and Scope.addNameOccurrence(NameOccurrence)
can
be used correctly.
- Specified by:
addDeclaration
in interface Scope
- Overrides:
addDeclaration
in class AbstractScope
- Parameters:
declaration
- the declaration to add
checkForDuplicatedNameDeclaration
protected void checkForDuplicatedNameDeclaration(NameDeclaration declaration)
contains
public boolean contains(NameOccurrence occurrence)
- Description copied from interface:
Scope
- Tests whether or not a
NameOccurrence
is directly contained in the scope.
This means, whether the given NameOccurrence
references a declaration, that has been
declared within this scope.
Note that this search is just for this scope - it doesn't go diving into any
parent scopes.
- Specified by:
contains
in interface Scope
- Overrides:
contains
in class AbstractScope
findVariableHere
protected abstract NameDeclaration findVariableHere(JavaNameOccurrence occurrence)
glomNames
protected <T> String glomNames(Set<T> s)
Copyright © 2002–2015 InfoEther. All rights reserved.