net.sourceforge.pmd.lang.java.symboltable
Class AbstractJavaScope

java.lang.Object
  extended by net.sourceforge.pmd.lang.symboltable.AbstractScope
      extended by 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

Constructor Summary
AbstractJavaScope()
           
 
Method Summary
 void addDeclaration(NameDeclaration declaration)
          Adds a new declaration to this scope.
protected  void checkForDuplicatedNameDeclaration(NameDeclaration declaration)
           
 boolean contains(NameOccurrence occurrence)
          Tests whether or not a NameOccurrence is directly contained in the scope.
protected abstract  NameDeclaration findVariableHere(JavaNameOccurrence occurrence)
           
protected
<T> String
glomNames(Set<T> s)
           
 
Methods inherited from class net.sourceforge.pmd.lang.symboltable.AbstractScope
addNameOccurrence, getDeclarations, getDeclarations, getEnclosingScope, getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJavaScope

public AbstractJavaScope()
Method Detail

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.