net.sourceforge.pmd

Class RuleSet

public class RuleSet extends Object

This class represents a collectin 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()
Gives the description of this ruleset
LanguagegetLanguage()
StringgetName()
Gives the name of this ruleset
RulegetRuleByName(String ruleName)
Returns the Rule with the given name
CollectiongetRules()
Returns the actual Collection of rules in this ruleset
inthashCode()
voidsetDescription(String description)
Set the description of this ruleset
voidsetLanguage(Language language)
voidsetName(String name)
Set the name of this ruleset
intsize()
Returns the number of rules in this ruleset
booleanusesDFA()

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()
Gives the description of this ruleset

Returns: a String representing the description

getLanguage

public Language getLanguage()

Returns: Returns the language.

getName

public String getName()
Gives the name of this ruleset

Returns: a String representing the name

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 getRules()
Returns the actual Collection of rules in this ruleset

Returns: a Collection with the rules. All objects are of type {@link Rule}

hashCode

public int hashCode()

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

setDescription

public void setDescription(String description)
Set the description of this ruleset

Parameters: description a String representing the description

setLanguage

public void setLanguage(Language language)

Parameters: language The language to set.

setName

public void setName(String name)
Set the name of this ruleset

Parameters: name a String representing the 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