public class ClassModifiersClassFilter extends java.lang.Object implements ClassFilter
ClassModifiersClassFilter is a ClassFilter
that
matches class names that (a) can be loaded and (b) match a set of class
modifiers (as defined by the constants in the
java.lang.reflect.Modifier class). For instance, the the
following code fragment defines a filter that will match only public
final classes:
import java.lang.reflect.Modifier; ... ClassFilter = new ClassModifiersClassFilter (Modifier.PUBLIC | Modifier.FINAL);
This class relies on the pool of classes read by a
ClassFinder
; it's not really useful by itself.
ClassFilter
,
ClassFinder
,
Modifier
Constructor and Description |
---|
ClassModifiersClassFilter(int modifiers)
Construct a new ClassModifiersClassFilter that will accept
any classes with the specified modifiers.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(ClassInfo classInfo,
ClassFinder classFinder)
Tests whether a class name should be included in a class name
list.
|
public ClassModifiersClassFilter(int modifiers)
modifiers
- the bit-field of modifier flags. See the
java.lang.reflect.Modifier class for
legal values.public boolean accept(ClassInfo classInfo, ClassFinder classFinder)
accept
in interface ClassFilter
classInfo
- the loaded information about the classclassFinder
- the ClassFinder
that called this filter
(mostly for access to ClassFinder
utility methods)