01: package tijmp.filter;
02:
03: import tijmp.ui.Translator;
04:
05: /** A filter that only matches classes in a package or its sub packages
06: */
07: public class RecursiveFilter implements Filter {
08: private String prefix;
09:
10: public RecursiveFilter(String prefix) {
11: if (prefix == null)
12: throw new IllegalArgumentException(
13: "null is not a valid prefix");
14: this .prefix = prefix;
15: }
16:
17: public boolean accept(Class<?> c) {
18: if (c == null)
19: return false;
20: String hrn = Translator.translate(c);
21: return hrn.startsWith(prefix);
22: }
23: }
|