public class SourceFileScope extends AbstractJavaScope
Constructor and Description |
---|
SourceFileScope() |
SourceFileScope(String packageImage) |
Modifier and Type | Method and Description |
---|---|
void |
addDeclaration(NameDeclaration declaration) |
void |
configureImports(ClassLoader classLoader,
List<ASTImportDeclaration> imports)
Configures the type resolution for the symbol table.
|
protected NameDeclaration |
findVariableHere(JavaNameOccurrence occ) |
Map<ClassNameDeclaration,List<NameOccurrence>> |
getClassDeclarations()
Convenience method that casts the declarations to
ClassNameDeclaration s. |
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, glomNames
addNameOccurrence, getDeclarations, getDeclarations, getEnclosingScope, getParent, setParent
public 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)
addDeclaration
in interface Scope
addDeclaration
in class AbstractJavaScope
IllegalArgumentException
- if declaration is not a ClassNameDeclaration
public Map<ClassNameDeclaration,List<NameOccurrence>> getClassDeclarations()
ClassNameDeclaration
s.AbstractScope.getDeclarations()
protected NameDeclaration findVariableHere(JavaNameOccurrence occ)
findVariableHere
in class AbstractJavaScope
Copyright © 2002-2014 InfoEther. All Rights Reserved.