Package net.sourceforge.pmd
Class RuleSets
- java.lang.Object
-
- net.sourceforge.pmd.RuleSets
-
@Deprecated @InternalApi public class RuleSets extends Object
Deprecated.Internal APIGrouping of Rules per Language in a RuleSet.- Author:
- pieter_van_raemdonck - Application Engineers NV/SA - www.ae.be
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
applies(TextFile file)
Deprecated.Check if a given source file should be checked by rules in this RuleSets.void
apply(RootNode root, FileAnalysisListener listener)
Deprecated.Apply all applicable rules to the compilation units.Set<Rule>
getAllRules()
Deprecated.Return all rules from all rulesets.RuleSet[]
getAllRuleSets()
Deprecated.Get all the RuleSets.long
getChecksum()
Deprecated.Retrieves a checksum of the rulesets being used.Rule
getRuleByName(String ruleName)
Deprecated.Returns the first Rule found with the given name.Iterator<RuleSet>
getRuleSetsIterator()
Deprecated.void
initializeRules(LanguageProcessorRegistry lpReg, MessageReporter reporter)
Deprecated.void
removeDysfunctionalRules(Collection<Rule> collector)
Deprecated.Remove and collect any rules that report problems.int
ruleCount()
Deprecated.Determines the total count of rules that are used in all rule sets.
-
-
-
Constructor Detail
-
RuleSets
public RuleSets(RuleSets ruleSets)
Deprecated.Copy constructor. Deep copies RuleSets.- Parameters:
ruleSets
- The RuleSets to copy.
-
RuleSets
public RuleSets(Collection<? extends RuleSet> ruleSets)
Deprecated.
-
RuleSets
public RuleSets(RuleSet ruleSet)
Deprecated.Public constructor. Add the given rule set.- Parameters:
ruleSet
- the RuleSet
-
-
Method Detail
-
initializeRules
public void initializeRules(LanguageProcessorRegistry lpReg, MessageReporter reporter)
Deprecated.
-
getAllRuleSets
public RuleSet[] getAllRuleSets()
Deprecated.Get all the RuleSets.- Returns:
- RuleSet[]
-
getAllRules
public Set<Rule> getAllRules()
Deprecated.Return all rules from all rulesets.- Returns:
- Set
-
applies
public boolean applies(TextFile file)
Deprecated.Check if a given source file should be checked by rules in this RuleSets.- Parameters:
file
- the source file to check- Returns:
true
if the file should be checked,false
otherwise
-
apply
public void apply(RootNode root, FileAnalysisListener listener)
Deprecated.Apply all applicable rules to the compilation units. Applicable means the language of the rules must match the language of the source (@see applies).- Parameters:
root
- the List of compilation units; the type these must have, depends on the source languagelistener
- Listener that will handle events while analysing.
-
getRuleByName
public Rule getRuleByName(String ruleName)
Deprecated.Returns the first Rule found with the given name. Note: Since we support multiple languages, rule names are not expected to be unique within any specific ruleset.- Parameters:
ruleName
- the exact name of the rule to find- Returns:
- the rule or null if not found
-
ruleCount
public int ruleCount()
Deprecated.Determines the total count of rules that are used in all rule sets.- Returns:
- the count
-
removeDysfunctionalRules
public void removeDysfunctionalRules(Collection<Rule> collector)
Deprecated.Remove and collect any rules that report problems.- Parameters:
collector
-
-
getChecksum
public long getChecksum()
Deprecated.Retrieves a checksum of the rulesets being used. Any change to any rule of any ruleset should trigger a checksum change.- Returns:
- The checksum for this ruleset collection.
-
-