Class TypeSet.AbstractResolver
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.symboltable.TypeSet.AbstractResolver
-
- All Implemented Interfaces:
TypeSet.Resolver
- Direct Known Subclasses:
TypeSet.CurrentPackageResolver
,TypeSet.ExplicitImportResolver
,TypeSet.FullyQualifiedNameResolver
,TypeSet.ImplicitImportResolver
,TypeSet.ImportOnDemandResolver
- Enclosing class:
- TypeSet
public abstract static class TypeSet.AbstractResolver extends Object implements TypeSet.Resolver
Base Resolver class that support aPMDASMClassLoader
class loader.
-
-
Field Summary
Fields Modifier and Type Field Description protected PMDASMClassLoader
pmdClassLoader
the class loader.
-
Constructor Summary
Constructors Constructor Description AbstractResolver(PMDASMClassLoader pmdClassLoader)
Creates a new AbstractResolver that uses the given class loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
couldResolve(String name)
Checks if the given class could be resolved by this resolver.protected Class<?>
resolveMaybeInner(String name, String fqName)
Resolves the given class name with the given FQCN, considering it may be an inner class.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symboltable.TypeSet.Resolver
resolve
-
-
-
-
Field Detail
-
pmdClassLoader
protected final PMDASMClassLoader pmdClassLoader
the class loader.
-
-
Constructor Detail
-
AbstractResolver
public AbstractResolver(PMDASMClassLoader pmdClassLoader)
Creates a new AbstractResolver that uses the given class loader.- Parameters:
pmdClassLoader
- the class loader to use
-
-
Method Detail
-
resolveMaybeInner
protected Class<?> resolveMaybeInner(String name, String fqName)
Resolves the given class name with the given FQCN, considering it may be an inner class.- Parameters:
name
- The name of the class to load.fqName
- The proposed FQCN for the class.- Returns:
- The matched class or null if not found.
-
couldResolve
public boolean couldResolve(String name)
Description copied from interface:TypeSet.Resolver
Checks 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:
couldResolve
in interfaceTypeSet.Resolver
- Parameters:
name
- the name of the class, might be fully classified or not.- Returns:
- whether the class can be resolved
-
-