nextMatchedIsDisabled = "true".equals(disabled);
if (qName.equals("Bug")) {
addMatcher(new BugMatcher(getOptionalAttribute(attributes, "code"), getOptionalAttribute(attributes, "pattern"),
getOptionalAttribute(attributes, "category")));
} else if (qName.equals("Class")) {
addMatcher(new ClassMatcher(getRequiredAttribute(attributes, "name", qName)));
} else if (qName.equals("FirstVersion")) {
addMatcher(new FirstVersionMatcher(getRequiredAttribute(attributes, "value", qName), getRequiredAttribute(attributes,
"relOp", qName)));
} else if (qName.equals("LastVersion")) {
addMatcher(new LastVersionMatcher(getRequiredAttribute(attributes, "value", qName), getRequiredAttribute(attributes,
"relOp", qName)));
} else if (qName.equals("Designation")) {
addMatcher(new DesignationMatcher(getRequiredAttribute(attributes, "designation", qName)));
} else if (qName.equals("BugCode")) {
addMatcher(new BugMatcher(getRequiredAttribute(attributes, "name", qName), "", ""));
} else if (qName.equals("Local")) {
addMatcher(new LocalMatcher(getRequiredAttribute(attributes, "name", qName)));
} else if (qName.equals("BugPattern")) {
addMatcher(new BugMatcher("", getRequiredAttribute(attributes, "name", qName), ""));
} else if (qName.equals("Priority")) {
addMatcher(new PriorityMatcher(getRequiredAttribute(attributes, "value", qName)));
} else if (qName.equals("Confidence")) {
addMatcher(new ConfidenceMatcher(getRequiredAttribute(attributes, "value", qName)));
} else if (qName.equals("Rank")) {
addMatcher(new RankMatcher(getRequiredAttribute(attributes, "value", qName)));
} else if (qName.equals("Package")) {
String pName = getRequiredAttribute(attributes, "name", qName);
pName = pName.startsWith("~") ? pName : "~" + pName.replace(".", "\\.");
addMatcher(new ClassMatcher(pName + "\\.[^.]+"));
} else if (qName.equals("Method")) {
String name = getOptionalAttribute(attributes, "name");
String params = getOptionalAttribute(attributes, "params");
String returns = getOptionalAttribute(attributes, "returns");
String role = getOptionalAttribute(attributes, "role");
addMatcher(new MethodMatcher(name, params, returns, role));
} else if (qName.equals("Field")) {
String name = getOptionalAttribute(attributes, "name");
String type = getOptionalAttribute(attributes, "type");
addMatcher(new FieldMatcher(name, type));
} else if (qName.equals("Or")) {
CompoundMatcher matcher = new OrMatcher();
pushCompoundMatcherAsChild(matcher);
} else if (qName.equals("And") || qName.equals("Match")) {
AndMatcher matcher = new AndMatcher();
pushCompoundMatcherAsChild(matcher);
if (qName.equals("Match")) {
String classregex = getOptionalAttribute(attributes, "classregex");
String classMatch = getOptionalAttribute(attributes, "class");
if (classregex != null) {
addMatcher(new ClassMatcher("~" + classregex));
} else if (classMatch != null) {
addMatcher(new ClassMatcher(classMatch));
}
}
} else if(qName.equals("Not")) {
NotMatcher matcher = new NotMatcher();
pushCompoundMatcherAsChild(matcher);