public class SourceFileScope extends AbstractJavaScope
Constructor | Description |
---|---|
SourceFileScope(java.lang.ClassLoader classLoader) |
|
SourceFileScope(java.lang.ClassLoader classLoader,
java.lang.String packageImage) |
Modifier and Type | Method | Description |
---|---|---|
void |
addDeclaration(net.sourceforge.pmd.lang.symboltable.NameDeclaration declaration) |
|
void |
configureImports(java.util.List<ASTImportDeclaration> imports) |
Configures the type resolution for the symbol table.
|
ClassNameDeclaration |
findClassNameDeclaration(java.lang.String name) |
|
protected java.util.Set<net.sourceforge.pmd.lang.symboltable.NameDeclaration> |
findVariableHere(JavaNameOccurrence occ) |
|
java.util.Map<ClassNameDeclaration,java.util.List<net.sourceforge.pmd.lang.symboltable.NameOccurrence>> |
getClassDeclarations() |
Convenience method that casts the declarations to
ClassNameDeclaration s. |
java.util.Set<java.lang.String> |
getExplicitImports() |
|
java.lang.String |
getPackageName() |
|
java.util.Map<java.lang.String,net.sourceforge.pmd.lang.ast.Node> |
getQualifiedTypeNames() |
Returns a set of all types defined within this source file.
|
boolean |
hasAuxclasspath() |
Whether an auxclasspath has been configured or not.
|
java.lang.Class<?> |
resolveType(java.lang.String name) |
Tries to resolve a class by name.
|
java.lang.String |
toString() |
checkForDuplicatedNameDeclaration, contains, glomNames
addNameOccurrence, getDeclarations, getDeclarations, getEnclosingScope, getParent, setParent
public SourceFileScope(java.lang.ClassLoader classLoader)
public SourceFileScope(java.lang.ClassLoader classLoader, java.lang.String packageImage)
public void configureImports(java.util.List<ASTImportDeclaration> imports)
imports
- the import declarationspublic java.util.Set<java.lang.String> getExplicitImports()
public boolean hasAuxclasspath()
true
if the auxclasspath is configured and types can
be resolved reliably.resolveType(String)
public java.lang.Class<?> resolveType(java.lang.String name)
name
- the name of the classnull
if no class could be foundpublic java.lang.String getPackageName()
public void addDeclaration(net.sourceforge.pmd.lang.symboltable.NameDeclaration declaration)
addDeclaration
in class AbstractJavaScope
java.lang.IllegalArgumentException
- if declaration is not a ClassNameDeclaration
public java.util.Map<ClassNameDeclaration,java.util.List<net.sourceforge.pmd.lang.symboltable.NameOccurrence>> getClassDeclarations()
ClassNameDeclaration
s.AbstractScope.getDeclarations()
public java.lang.String toString()
toString
in class java.lang.Object
public ClassNameDeclaration findClassNameDeclaration(java.lang.String name)
protected java.util.Set<net.sourceforge.pmd.lang.symboltable.NameDeclaration> findVariableHere(JavaNameOccurrence occ)
findVariableHere
in class AbstractJavaScope
public java.util.Map<java.lang.String,net.sourceforge.pmd.lang.ast.Node> getQualifiedTypeNames()
Copyright © 2002–2018 PMD. All rights reserved.