net.sourceforge.pmd

Class RuleSet

public class RuleSet extends Object

This class represents a collection of rules.

See Also: Rule

Method Summary
voidaddRule(Rule rule)
Add a new rule to this ruleset
voidaddRuleSet(RuleSet ruleSet)
Add a whole RuleSet to this RuleSet
voidapply(List acuList, RuleContext ctx)
booleanequals(Object o)
StringgetDescription()
LanguagegetLanguage()
StringgetName()
RulegetRuleByName(String ruleName)
Returns the Rule with the given name
Collection<Rule>getRules()
Returns the actual Collection of rules in this ruleset
inthashCode()
voidsetDescription(String description)
voidsetLanguage(Language language)
voidsetName(String name)
intsize()
Returns the number of rules in this ruleset
booleanusesDFA()
booleanusesTypeResolution()

Method Detail

addRule

public void addRule(Rule rule)
Add a new rule to this ruleset

Parameters: rule the rule to be added

addRuleSet

public void addRuleSet(RuleSet ruleSet)
Add a whole RuleSet to this RuleSet

Parameters: ruleSet the RuleSet to add

apply

public void apply(List acuList, RuleContext ctx)

equals

public boolean equals(Object o)

See Also: java.lang.Object#equals(java.lang.Object)

getDescription

public String getDescription()

getLanguage

public Language getLanguage()

getName

public String getName()

getRuleByName

public Rule getRuleByName(String ruleName)
Returns the Rule with the given name

Parameters: ruleName the name of the rule to find

Returns: the rule or null if not found

getRules

public Collection<Rule> getRules()
Returns the actual Collection of rules in this ruleset

Returns: a Collection with the rules. All objects are of type Rule

hashCode

public int hashCode()

See Also: java.lang.Object#hashCode()

setDescription

public void setDescription(String description)

setLanguage

public void setLanguage(Language language)

setName

public void setName(String name)

size

public int size()
Returns the number of rules in this ruleset

Returns: an int representing the number of rules

usesDFA

public boolean usesDFA()

Returns: true if any rule in the RuleSet needs the DFA layer

usesTypeResolution

public boolean usesTypeResolution()