01: package tijmp.filter;
02:
03: /** A filter that matches some common array classes.
04: * Usually only useful for default removal of classes.
05: */
06: public class CommonArrayFilter implements Filter {
07: private static final String[] prefixes = { "Ljava.", "Lsun.",
08: "Ljavax.", "Ltijmp." };
09:
10: public boolean accept(Class<?> c) {
11: String name = c.getName();
12: int i = 0;
13: while (name.length() > 0 && name.charAt(i) == '[')
14: i++;
15: name = name.substring(i);
16: for (String p : prefixes)
17: if (name.startsWith(p))
18: return true;
19: return false;
20: }
21: }
|