public RuleSets()
Public constructor.
public RuleSets(RuleSets ruleSets)
Copy constructor. Deep copies RuleSets.
ruleSets
- The RuleSets to copy.
public RuleSets(RuleSet ruleSet)
Public constructor. Add the given rule set.
ruleSet
- the RuleSet
public void addRuleSet(RuleSet ruleSet)
Add a ruleset for a language. Only one ruleset can be added for a specific language. If ruleSet.getLanguage() is null, it is assumed to be a RuleSet of java rules.
ruleSet
- the RuleSet
public RuleSet[] getAllRuleSets()
Get all the RuleSets.
public java.util.Iterator<RuleSet> getRuleSetsIterator()
public java.util.Set<Rule> getAllRules()
Return all rules from all rulesets.
public boolean applies(java.io.File file)
Check if a given source file should be checked by rules in this RuleSets.
file
- the source file to check
true
if the file should be checked, false
otherwise
public void start(RuleContext ctx)
Notify all rules of the start of processing.
public void apply(java.util.List<Node> acuList, RuleContext ctx, Language language)
Apply all applicable rules to the compilation units. Applicable means the language of the rules must match the language of the source (@see applies).
acuList
- the List of compilation units; the type these must have, depends on the source language
ctx
- the RuleContext
language
- the Language of the source
public void end(RuleContext ctx)
Notify all rules of the end of processing.
@Deprecated public boolean usesDFA(Language language)
Check if the rules that apply to a source of the given language use DFA.
language
- the language of a source
public Rule getRuleByName(java.lang.String ruleName)
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.
ruleName
- the exact name of the rule to find
public int ruleCount()
Determines the total count of rules that are used in all rule sets.
@Deprecated public boolean usesTypeResolution(Language language)
Does any Rule for the given Language use Type Resolution?
language
- The Language.
true
if a Rule for the Language uses Type Resolution, false
otherwise.
@Deprecated public boolean usesMultifile(Language language)
Does any Rule for the given Language use multi-file analysis?
language
- The Language.
true
if a Rule for the Language uses multi file analysis, false
otherwise.
public void removeDysfunctionalRules(java.util.Collection<Rule> collector)
Remove and collect any rules that report problems.
collector
-
public long getChecksum()
Retrieves a checksum of the rulesets being used. Any change to any rule of any ruleset should trigger a checksum change.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4