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
ClassNameDeclarations. |
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, glomNamesaddNameOccurrence, getDeclarations, getDeclarations, getEnclosingScope, getParent, setParentpublic 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 AbstractJavaScopejava.lang.IllegalArgumentException - if declaration is not a ClassNameDeclarationpublic java.util.Map<ClassNameDeclaration,java.util.List<net.sourceforge.pmd.lang.symboltable.NameOccurrence>> getClassDeclarations()
ClassNameDeclarations.AbstractScope.getDeclarations()public java.lang.String toString()
toString in class java.lang.Objectpublic ClassNameDeclaration findClassNameDeclaration(java.lang.String name)
protected java.util.Set<net.sourceforge.pmd.lang.symboltable.NameDeclaration> findVariableHere(JavaNameOccurrence occ)
findVariableHere in class AbstractJavaScopepublic java.util.Map<java.lang.String,net.sourceforge.pmd.lang.ast.Node> getQualifiedTypeNames()
Copyright © 2002–2018 PMD. All rights reserved.