org.sonar.api.batch.rule
Interface ActiveRules

All Superinterfaces:
BatchComponent
All Known Implementing Classes:
DefaultActiveRules

public interface ActiveRules
extends BatchComponent

The rules that are activated on the current module. Quality profiles are merged, so rules can relate to different repositories and languages.

Use ActiveRulesBuilder to instantiate this component in unit tests.

Since:
4.2

Method Summary
 ActiveRule find(RuleKey ruleKey)
          Find a ActiveRule by the associated rule key.
 Collection<ActiveRule> findAll()
          All the active rules, whatever their repository and related language.
 ActiveRule findByInternalKey(String repository, String internalKey)
          Find a ActiveRule by the associated internal key.
 Collection<ActiveRule> findByLanguage(String language)
          The active rules for a given language, like java
 Collection<ActiveRule> findByRepository(String repository)
          The active rules for a given repository, like findbugs
 

Method Detail

find

@CheckForNull
ActiveRule find(RuleKey ruleKey)
Find a ActiveRule 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 module.


findAll

Collection<ActiveRule> findAll()
All the active rules, whatever their repository and related language.


findByRepository

Collection<ActiveRule> findByRepository(String repository)
The active rules for a given repository, like findbugs


findByLanguage

Collection<ActiveRule> findByLanguage(String language)
The active rules for a given language, like java


findByInternalKey

@CheckForNull
ActiveRule findByInternalKey(String repository,
                                          String internalKey)
Find a ActiveRule 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 module.



Copyright © 2009–2015 SonarSource. All rights reserved.