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