Class TypeSet.FullyQualifiedNameResolver
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.symboltable.TypeSet.AbstractResolver
-
- net.sourceforge.pmd.lang.java.symboltable.TypeSet.FullyQualifiedNameResolver
-
- All Implemented Interfaces:
TypeSet.Resolver
- Enclosing class:
- TypeSet
public static class TypeSet.FullyQualifiedNameResolver extends TypeSet.AbstractResolver
Resolver that simply loads the class by name. This only works if the class name is given as a fully qualified name.
-
-
Field Summary
-
Fields inherited from class net.sourceforge.pmd.lang.java.symboltable.TypeSet.AbstractResolver
pmdClassLoader
-
-
Constructor Summary
Constructors Constructor Description FullyQualifiedNameResolver(PMDASMClassLoader pmdClassLoader)
Creates aTypeSet.FullyQualifiedNameResolver
-
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.Class<?>
resolve(String name)
Resolve the class by the given name-
Methods inherited from class net.sourceforge.pmd.lang.java.symboltable.TypeSet.AbstractResolver
resolveMaybeInner
-
-
-
-
Constructor Detail
-
FullyQualifiedNameResolver
public FullyQualifiedNameResolver(PMDASMClassLoader pmdClassLoader)
Creates aTypeSet.FullyQualifiedNameResolver
- Parameters:
pmdClassLoader
- the class loader to use
-
-
Method Detail
-
resolve
public Class<?> resolve(String name) throws ClassNotFoundException
Description copied from interface:TypeSet.Resolver
Resolve the class by the given name- Parameters:
name
- the name of the class, might be fully classified or not.- Returns:
- the class
- Throws:
ClassNotFoundException
- if the class couldn't be 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
- Overrides:
couldResolve
in classTypeSet.AbstractResolver
- Parameters:
name
- the name of the class, might be fully classified or not.- Returns:
- whether the class can be resolved
-
-