Methods Summary |
---|
public void | addTypePatterns(java.lang.String group, java.lang.String patterns)
boolean conditional;
// If a pattern starts with '-', it matches only if there
// were no earlier matches
if (patterns.charAt(0) == '-") {
conditional = true;
patterns = patterns.substring(1);
} else {
conditional = false;
}
ClassnameFilter f = new ClassnameFilter(conditional);
parseClassList( patterns, f );
groups.addElement(group.intern());
filters.addElement(f);
|
public java.lang.String[] | getTypes(java.lang.String classname)
Vector types = new Vector(1);
int l = groups.size();
for (int i = 0; i < l; ++i) {
String name = (String)groups.elementAt(i);
ClassnameFilter f = (ClassnameFilter)filters.elementAt(i);
// If a pattern is conditional, it matches only if there
// were no earlier matches
if (types.size() == 0 || !f.conditional) {
if (f.accept(null, classname)) {
types.addElement(name);
}
}
}
String[] strings = new String[types.size()];
types.copyInto(strings);
return strings;
|
public boolean | isType(java.lang.String classname, java.lang.String type)
String[] types = getTypes(classname);
for (int i = 0; i < types.length; ++i) {
if (types[i] == type.intern()) {
return true;
}
}
return false;
|
private void | parseClassList(java.lang.String val, ClassnameFilter filter)
java.util.StringTokenizer tkn =
new java.util.StringTokenizer(val, " ,", false );
while ( tkn.hasMoreTokens() ){
String classname =
util.LinkerUtil.sanitizeClassname( tkn.nextToken() );
filter.includeName(classname);
}
|