ChecksumAwarepublic class RuleSet extends java.lang.Object implements ChecksumAware
Rule| Modifier and Type | Method | Description |
|---|---|---|
boolean |
applies(java.io.File file) |
Check if a given source file should be checked by rules in this RuleSet.
|
static boolean |
applies(Rule rule,
LanguageVersion languageVersion) |
Does the given Rule apply to the given LanguageVersion? If so, the
Language must be the same and be between the minimum and maximums
versions on the Rule.
|
void |
apply(java.util.List<? extends Node> acuList,
RuleContext ctx) |
Executes the rules in this ruleset against each of the given nodes.
|
void |
end(RuleContext ctx) |
Triggers the end lifecycle event on each rule in the ruleset.
|
boolean |
equals(java.lang.Object o) |
Two rulesets are equals, if they have the same name and contain the same
rules.
|
long |
getChecksum() |
Retrieves the current instance checksum
|
java.lang.String |
getDescription() |
|
java.util.List<java.lang.String> |
getExcludePatterns() |
|
java.lang.String |
getFileName() |
|
java.util.List<java.lang.String> |
getIncludePatterns() |
|
java.lang.String |
getName() |
|
Rule |
getRuleByName(java.lang.String ruleName) |
Returns the first Rule found with the given name (case-sensitive).
|
java.util.Collection<Rule> |
getRules() |
Returns the actual Collection of rules in this ruleset
|
int |
hashCode() |
|
void |
removeDysfunctionalRules(java.util.Collection<Rule> collector) |
Remove and collect any misconfigured rules.
|
int |
size() |
Returns the number of rules in this ruleset
|
void |
start(RuleContext ctx) |
Triggers that start lifecycle event on each rule in this ruleset.
|
boolean |
usesDFA(Language language) |
Does any Rule for the given Language use the DFA layer?
|
boolean |
usesMultifile(Language language) |
Does any Rule for the given Language use multi-file analysis?
|
boolean |
usesTypeResolution(Language language) |
Does any Rule for the given Language use Type Resolution?
|
public RuleSet(RuleSet rs)
public int size()
public java.util.Collection<Rule> getRules()
Rulepublic Rule getRuleByName(java.lang.String ruleName)
ruleName - the exact name of the rule to findpublic boolean applies(java.io.File file)
exclude pattern
which matches the file, unless there is an include pattern
which also matches the file. In other words, include
patterns override exclude patterns.file - the source file to checktrue if the file should be checked,
false otherwisepublic void start(RuleContext ctx)
ctx - the current contextpublic void apply(java.util.List<? extends Node> acuList, RuleContext ctx)
acuList - the node list, usually the root nodes like compilation unitsctx - the current contextpublic static boolean applies(Rule rule, LanguageVersion languageVersion)
rule - The rule.languageVersion - The language version.true if the given rule matches the given language,
which means, that the rule would be executed.public void end(RuleContext ctx)
ctx - the current contextpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the other ruleset to compare withtrue if o is a ruleset with the same name and rules,
false otherwisepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getFileName()
public java.lang.String getName()
public java.lang.String getDescription()
public java.util.List<java.lang.String> getExcludePatterns()
public java.util.List<java.lang.String> getIncludePatterns()
public boolean usesDFA(Language language)
language - The Language.true if a Rule for the Language uses the DFA layer,
false otherwise.public boolean usesTypeResolution(Language language)
language - The Language.true if a Rule for the Language uses Type
Resolution, false otherwise.public boolean usesMultifile(Language language)
language - The Language.true if a Rule for the Language uses multi file analysis,
false otherwise.public void removeDysfunctionalRules(java.util.Collection<Rule> collector)
collector - the removed rules will be added to this collectionpublic long getChecksum()
ChecksumAwaregetChecksum in interface ChecksumAwareCopyright © 2002–2018 PMD. All rights reserved.