public class SubclassClassFilter extends java.lang.Object implements ClassFilter
SubclassClassFilter is a ClassFilter
that matches
class names that (a) can be loaded and (b) extend a given subclass or
implement a specified interface, directly or indirectly. It uses the
java.lang.Class.isAssignableFrom() method, so it actually has to
load each class it tests. For maximum flexibility, a
SubclassClassFilter can be configured to use a specific class
loader.
Constructor and Description |
---|
SubclassClassFilter(java.lang.Class baseClassOrInterface)
Construct a new SubclassClassFilter that will accept
only classes that extend the specified class or implement the
specified interface.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(ClassInfo classInfo,
ClassFinder classFinder)
Perform the acceptance test on the loaded Class object.
|
public SubclassClassFilter(java.lang.Class baseClassOrInterface)
baseClassOrInterface
- the base class or interfacepublic boolean accept(ClassInfo classInfo, ClassFinder classFinder)
accept
in interface ClassFilter
classInfo
- the ClassInfo
object to testclassFinder
- the invoking ClassFinder
object