Class TypeSet.ImportOnDemandResolver
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.symboltable.TypeSet.AbstractResolver
-
- net.sourceforge.pmd.lang.java.symboltable.TypeSet.ImportOnDemandResolver
-
- All Implemented Interfaces:
TypeSet.Resolver
- Enclosing class:
- TypeSet
public static class TypeSet.ImportOnDemandResolver extends TypeSet.AbstractResolver
Resolver that uses the "on demand" import statements.
-
-
Field Summary
-
Fields inherited from class net.sourceforge.pmd.lang.java.symboltable.TypeSet.AbstractResolver
pmdClassLoader
-
-
Constructor Summary
Constructors Constructor Description ImportOnDemandResolver(PMDASMClassLoader pmdClassLoader, java.util.Set<java.lang.String> importStmts)Creates aTypeSet.ImportOnDemandResolver
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancouldResolve(java.lang.String name)Checks if the given class could be resolved by this resolver.java.lang.Class<?>resolve(java.lang.String name)Resolve the class by the given name-
Methods inherited from class net.sourceforge.pmd.lang.java.symboltable.TypeSet.AbstractResolver
resolveMaybeInner
-
-
-
-
Constructor Detail
-
ImportOnDemandResolver
public ImportOnDemandResolver(PMDASMClassLoader pmdClassLoader, java.util.Set<java.lang.String> importStmts)
Creates aTypeSet.ImportOnDemandResolver- Parameters:
pmdClassLoader- the class loader to useimportStmts- the import statements
-
-
Method Detail
-
resolve
public java.lang.Class<?> resolve(java.lang.String name) throws java.lang.ClassNotFoundExceptionDescription copied from interface:TypeSet.ResolverResolve the class by the given name- Parameters:
name- the name of the class, might be fully classified or not.- Returns:
- the class
- Throws:
java.lang.ClassNotFoundException- if the class couldn't be found
-
couldResolve
public boolean couldResolve(java.lang.String name)
Description copied from interface:TypeSet.ResolverChecks if the given class could be resolved by this resolver. Notice, that a resolver's ability to resolve a class does not imply that the class will actually be found and resolved.- Specified by:
couldResolvein interfaceTypeSet.Resolver- Overrides:
couldResolvein classTypeSet.AbstractResolver- Parameters:
name- the name of the class, might be fully classified or not.- Returns:
- whether the class can be resolved
-
-