Package org.sonar.api.batch.rule
Interface ActiveRules
-
@Immutable @ScannerSide public interface ActiveRules
The rules that are activated on the current project. Quality profiles are merged, so rules can relate to different repositories and languages.
Useorg.sonar.api.batch.rule.internal.ActiveRulesBuilder
available in sonar-plugin-api-impl to instantiate this component in unit tests.- Since:
- 4.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActiveRule
find(RuleKey ruleKey)
Find aActiveRule
by the associated rule key.java.util.Collection<ActiveRule>
findAll()
All the active rules, whatever their repository and related language.ActiveRule
findByInternalKey(java.lang.String repository, java.lang.String internalKey)
Find aActiveRule
by the associated internal key.java.util.Collection<ActiveRule>
findByLanguage(java.lang.String language)
The active rules for a given language, likejava
java.util.Collection<ActiveRule>
findByRepository(java.lang.String repository)
The active rules for a given repository, likefindbugs
-
-
-
Method Detail
-
find
@CheckForNull ActiveRule find(RuleKey ruleKey)
Find aActiveRule
by the associated rule key.null
is returned if the rule does not exist or if the rule is not activated on any Quality profile associated with the project.
-
findAll
java.util.Collection<ActiveRule> findAll()
All the active rules, whatever their repository and related language.
-
findByRepository
java.util.Collection<ActiveRule> findByRepository(java.lang.String repository)
The active rules for a given repository, likefindbugs
-
findByLanguage
java.util.Collection<ActiveRule> findByLanguage(java.lang.String language)
The active rules for a given language, likejava
-
findByInternalKey
@CheckForNull ActiveRule findByInternalKey(java.lang.String repository, java.lang.String internalKey)
Find aActiveRule
by the associated internal key.null
is returned if the rule does not exist or if the rule is not activated on any Quality profile associated with the project.
-
-