use of net.sourceforge.pmd.RuleSetReference in project pmd-eclipse-plugin by pmd.
the class RuleSetUtil method addRuleSetByReference.
public static RuleSet addRuleSetByReference(RuleSet ruleSet, RuleSet sourceRuleSet, boolean allRules) {
RuleSetReference reference = new RuleSetReference(sourceRuleSet.getFileName(), allRules);
Collection<Rule> rules = new ArrayList<Rule>(ruleSet.getRules());
for (Rule rule : sourceRuleSet.getRules()) {
RuleReference ruleRef = new RuleReference(rule, reference);
rules.add(ruleRef);
}
RuleSetFactory factory = new RuleSetFactory();
return factory.createNewRuleSet(ruleSet.getName(), ruleSet.getDescription(), ruleSet.getFileName(), ruleSet.getExcludePatterns(), ruleSet.getIncludePatterns(), rules);
}
Aggregations