public class RulesProfile extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
static String |
SONAR_WAY_FINDBUGS_NAME
Name of the default java profile "Sonar way with Findbugs"
|
static String |
SONAR_WAY_NAME
Name of the default profile "Sonar Way"
|
static String |
SUN_CONVENTIONS_NAME
Name of the default java profile "Sun checks"
|
Constructor and Description |
---|
RulesProfile()
Deprecated.
use the factory method create()
|
RulesProfile(String name,
String language)
Deprecated.
since 2.3. Use the factory method create()
|
RulesProfile(String name,
String language,
boolean defaultProfile,
boolean provided)
Deprecated.
since 2.3. Use the factory method create()
|
Modifier and Type | Method and Description |
---|---|
ActiveRule |
activateRule(Rule rule,
RulePriority optionalSeverity) |
RulesProfile |
addActiveRule(ActiveRule activeRule) |
Object |
clone() |
static RulesProfile |
create() |
static RulesProfile |
create(String name,
String language) |
boolean |
equals(Object obj) |
ActiveRule |
getActiveRule(Rule rule)
Note: disabled rules are excluded.
|
ActiveRule |
getActiveRule(String repositoryKey,
String ruleKey)
Note: disabled rules are excluded.
|
ActiveRule |
getActiveRuleByConfigKey(String repositoryKey,
String configKey)
Note: disabled rules are excluded.
|
List<ActiveRule> |
getActiveRules() |
List<ActiveRule> |
getActiveRules(boolean acceptDisabledRules) |
List<ActiveRule> |
getActiveRules(RulePriority severity)
Note: disabled rules are excluded.
|
List<ActiveRule> |
getActiveRulesByPlugin(String repositoryKey)
Deprecated.
since 2.3 use
getActiveRulesByRepository(String) instead. |
List<ActiveRule> |
getActiveRulesByRepository(String repositoryKey)
Get the active rules of a specific repository.
|
List<Alert> |
getAlerts() |
Boolean |
getDefaultProfile() |
Boolean |
getEnabled() |
Integer |
getId() |
String |
getLanguage() |
String |
getName() |
String |
getParentName()
For internal use only.
|
List<ResourceModel> |
getProjects() |
Boolean |
getProvided() |
Boolean |
getUsed() |
int |
getVersion() |
int |
hashCode() |
boolean |
isEnabled() |
RulesProfile |
removeActiveRule(ActiveRule activeRule) |
void |
setActiveRules(List<ActiveRule> activeRules)
Set the list of active rules
|
void |
setAlerts(List<Alert> alerts)
Sets the list of alerts for the profile
|
void |
setDefaultProfile(Boolean b)
Set whether this is the default profile for the language.
|
RulesProfile |
setEnabled(Boolean b) |
RulesProfile |
setLanguage(String s)
Set the profile language
|
RulesProfile |
setName(String s)
Set the profile name.
|
void |
setParentName(String parentName)
For internal use only.
|
void |
setProjects(List<ResourceModel> projects)
Sets the list of projects attached to the profile
|
void |
setProvided(Boolean b)
Set whether the profile is provided by a plugin
|
RulesProfile |
setUsed(Boolean used) |
RulesProfile |
setVersion(int version) |
String |
toString() |
public static final String SONAR_WAY_NAME
public static final String SONAR_WAY_FINDBUGS_NAME
public static final String SUN_CONVENTIONS_NAME
@Deprecated public RulesProfile()
@Deprecated public RulesProfile(String name, String language)
@Deprecated public RulesProfile(String name, String language, boolean defaultProfile, boolean provided)
public RulesProfile setName(String s)
public int getVersion()
public RulesProfile setVersion(int version)
public RulesProfile setUsed(Boolean used)
public List<ActiveRule> getActiveRules()
public List<ActiveRule> getActiveRules(boolean acceptDisabledRules)
public RulesProfile removeActiveRule(ActiveRule activeRule)
public RulesProfile addActiveRule(ActiveRule activeRule)
public void setActiveRules(List<ActiveRule> activeRules)
public Boolean getDefaultProfile()
public void setDefaultProfile(Boolean b)
public Boolean getProvided()
public void setProvided(Boolean b)
public Boolean getEnabled()
public boolean isEnabled()
public RulesProfile setEnabled(Boolean b)
public String getLanguage()
public RulesProfile setLanguage(String s)
public String getParentName()
public void setParentName(String parentName)
public List<ResourceModel> getProjects()
public void setProjects(List<ResourceModel> projects)
public List<ActiveRule> getActiveRules(RulePriority severity)
@Deprecated public List<ActiveRule> getActiveRulesByPlugin(String repositoryKey)
getActiveRulesByRepository(String)
instead.public List<ActiveRule> getActiveRulesByRepository(String repositoryKey)
public ActiveRule getActiveRule(String repositoryKey, String ruleKey)
public ActiveRule getActiveRuleByConfigKey(String repositoryKey, String configKey)
public ActiveRule getActiveRule(Rule rule)
public ActiveRule activateRule(Rule rule, RulePriority optionalSeverity)
optionalSeverity
- if null, then the default rule severity is usedpublic static RulesProfile create(String name, String language)
public static RulesProfile create()
Copyright © 2009-2012 SonarSource. All Rights Reserved.