public class SourceFileScope extends AbstractJavaScope
| Constructor and Description |
|---|
SourceFileScope() |
SourceFileScope(String packageImage) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaration(NameDeclaration declaration)
Adds a new declaration to this scope.
|
void |
configureImports(ClassLoader classLoader,
List<ASTImportDeclaration> imports)
Configures the type resolution for the symbol table.
|
ClassNameDeclaration |
findClassNameDeclaration(String name) |
protected 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()
public SourceFileScope(String packageImage)
public void configureImports(ClassLoader classLoader, List<ASTImportDeclaration> imports)
classLoader - the class loader to use to find additional classesimports - 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)
Scope.contains(NameOccurrence) and Scope.addNameOccurrence(NameOccurrence) can
be used correctly.addDeclaration in interface ScopeaddDeclaration in class AbstractJavaScopedeclaration - the declaration to addIllegalArgumentException - if declaration is not a ClassNameDeclarationpublic Map<ClassNameDeclaration,List<NameOccurrence>> getClassDeclarations()
ClassNameDeclarations.AbstractScope.getDeclarations()public ClassNameDeclaration findClassNameDeclaration(String name)
protected NameDeclaration findVariableHere(JavaNameOccurrence occ)
findVariableHere in class AbstractJavaScopeCopyright © 2002–2016 InfoEther. All rights reserved.