public class RuleSets
extends java.lang.Object
Constructor and Description |
---|
RuleSets()
Public constructor.
|
RuleSets(RuleSet ruleSet)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addRuleSet(RuleSet ruleSet)
Add a ruleset for a language.
|
boolean |
applies(java.io.File file)
Check if a given source file should be checked by rules in this RuleSets.
|
boolean |
applies(Language languageOfSource,
Language languageOfRule)
Check if a source with given language should be checked by rules for a given
language.
|
void |
apply(java.util.List<CompilationUnit> acuList,
RuleContext ctx,
Language language)
Apply all applicable rules to the compilation units.
|
void |
end(RuleContext ctx)
Notify all rules of the end of processing.
|
java.util.Set<Rule> |
getAllRules()
Return all rules from all rulesets.
|
RuleSet[] |
getAllRuleSets()
Get all the RuleSets.
|
Rule |
getRuleByName(java.lang.String ruleName)
Returns the Rule with the given name
|
java.util.Iterator<RuleSet> |
getRuleSetsIterator() |
void |
start(RuleContext ctx)
Notify all rules of the start of processing.
|
boolean |
usesDFA(Language language)
Check if the rules that apply to a source of the given language
use DFA.
|
boolean |
usesTypeResolution(Language language) |
public RuleSets()
public RuleSets(RuleSet ruleSet)
ruleSet
- the RuleSetpublic void addRuleSet(RuleSet ruleSet)
ruleSet
- the RuleSetpublic RuleSet[] getAllRuleSets()
public java.util.Iterator<RuleSet> getRuleSetsIterator()
public java.util.Set<Rule> getAllRules()
public boolean applies(java.io.File file)
file
- the source file to checktrue
if the file should be checked, false
otherwisepublic boolean applies(Language languageOfSource, Language languageOfRule)
languageOfSource
- language of a source; can not be nulllanguageOfRule
- language of a ruleset; can be nullpublic void start(RuleContext ctx)
public void apply(java.util.List<CompilationUnit> acuList, RuleContext ctx, Language language)
acuList
- the List of compilation units; the type these must have,
depends on the source languagectx
- the RuleContextlanguage
- the Language of the sourcepublic void end(RuleContext ctx)
public boolean usesDFA(Language language)
language
- the language of a sourcepublic Rule getRuleByName(java.lang.String ruleName)
ruleName
- the name of the rule to findpublic boolean usesTypeResolution(Language language)