Package edu.umd.cs.findbugs.filter

Examples of edu.umd.cs.findbugs.filter.ClassMatcher


        case BUGCODE:
            return new BugMatcher(s.getFrom(bug), null, null);
        case CATEGORY:
            return new BugMatcher(null, null, s.getFrom(bug));
        case CLASS:
            return new ClassMatcher(s.getFrom(bug));
        case DESIGNATION:
            return new DesignationMatcher(s.getFrom(bug));

        case FIRSTVERSION:
            return new FirstVersionMatcher(s.getFrom(bug), RelationalOp.EQ);
        case LASTVERSION:
            return new LastVersionMatcher(s.getFrom(bug), RelationalOp.EQ);
        case PACKAGE:
            String p = Sortables.CLASS.getFrom(bug);
            int lastDot = p.lastIndexOf('.');
            if (lastDot > 0) {
                p = p.substring(0, lastDot);
            }
            return new ClassMatcher("~" + p + "\\.[^.]+");
        case PRIORITY:
            return new PriorityMatcher(Integer.toString(bug.getPriority()));

        case TYPE:
            return new BugMatcher(null, s.getFrom(bug), null);
View Full Code Here


        case BUGCODE:
            return new BugMatcher(value, null, null);
        case CATEGORY:
            return new BugMatcher(null, null, value);
        case CLASS:
            return new ClassMatcher(value);
        case DESIGNATION:
            return new DesignationMatcher(value);

        case FIRSTVERSION:
            return new FirstVersionMatcher(value, RelationalOp.EQ);
        case LASTVERSION:
            return new LastVersionMatcher(value, RelationalOp.EQ);
        case PACKAGE:
            return new ClassMatcher("~" + value + "\\.[^.]+");
        case PRIORITY:
            return new PriorityMatcher(value);
        case PROJECT:
            throw new NotImplementedYetException("Matchers for Projects not supported yet");
View Full Code Here

        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);
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.filter.ClassMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.