Represents a RuleSet. Testing doesn't work for it yet.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@146 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
36
pmd/src/net/sourceforge/pmd/RuleSet.java
Normal file
36
pmd/src/net/sourceforge/pmd/RuleSet.java
Normal file
@ -0,0 +1,36 @@
|
||||
package net.sourceforge.pmd;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class RuleSet
|
||||
{
|
||||
private Set rules = new HashSet();
|
||||
|
||||
public RuleSet() { }
|
||||
|
||||
public int size() {
|
||||
return rules.size();
|
||||
}
|
||||
|
||||
public void addRule( Rule rule ) {
|
||||
rules.add( rule );
|
||||
}
|
||||
|
||||
public Set getRules() {
|
||||
return rules;
|
||||
}
|
||||
|
||||
public void apply( List acuList,
|
||||
RuleContext ctx ) {
|
||||
Iterator rs = rules.iterator();
|
||||
while (rs.hasNext()) {
|
||||
Rule rule = (Rule) rs.next();
|
||||
|
||||
rule.apply( acuList, ctx );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user