01: package tijmp.filter;
02:
03: import java.util.regex.Matcher;
04: import java.util.regex.Pattern;
05: import tijmp.ui.Translator;
06:
07: /** A filter that uses a regexp to match classes
08: */
09: public class RegexpFilter implements Filter {
10: private Pattern p;
11:
12: public RegexpFilter(String pattern) {
13: p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
14: }
15:
16: public boolean accept(Class<?> c) {
17: String hrn = Translator.translate(c);
18: Matcher m = p.matcher(hrn);
19: return m.find();
20: }
21: }
|