org.sonar.api.profiles
Class RulesProfile

java.lang.Object
  extended by org.sonar.api.database.BaseIdentifiable
      extended by org.sonar.api.profiles.RulesProfile
All Implemented Interfaces:
java.lang.Cloneable

public class RulesProfile
extends BaseIdentifiable
implements java.lang.Cloneable

Class to map rules profile with hibernate model


Field Summary
static java.lang.String SONAR_WAY_FINDBUGS_NAME
          The profile key for the embedded profile Sonar Way with Findbugs
static java.lang.String SONAR_WAY_NAME
          The profile key for the embedded profile Sonar Way
static java.lang.String SUN_CONVENTIONS_NAME
          The profile key for the embedded profile Sun checks
 
Constructor Summary
RulesProfile()
          Default constructor
RulesProfile(java.lang.String name, java.lang.String language)
          Creates a profile of rules with empty active rules, empty alerts and empty project lists.
RulesProfile(java.lang.String name, java.lang.String language, boolean defaultProfile, boolean provided)
          Creates a profile of rules with empty active rules, empty alerts and empty project lists.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 ActiveRule getActiveRule(Rule rule)
          THIS METHOD SHOULD NOT BE USED AS CURRENTLY THE PLUGIN KEY CAN NOT BE DETERMINED
 ActiveRule getActiveRule(java.lang.String pluginKey, java.lang.String ruleKey)
           
 java.util.List<ActiveRule> getActiveRules()
           
 java.util.List<ActiveRule> getActiveRules(RulePriority priority)
           
 java.util.List<ActiveRule> getActiveRulesByPlugin(java.lang.String pluginKey)
           
 java.util.List<Alert> getAlerts()
           
 java.lang.Boolean getDefaultProfile()
           
 java.lang.String getLanguage()
           
 java.lang.String getName()
           
 java.util.List<ResourceModel> getProjects()
           
 java.lang.Boolean getProvided()
           
 int hashCode()
           
 void setActiveRules(java.util.List<ActiveRule> activeRules)
          Sets the list of active rules
 void setAlerts(java.util.List<Alert> alerts)
          Sets the list of alerts for the profile
 void setDefaultProfile(java.lang.Boolean defaultProfile)
          Sets whether this is the default profile for the language
 void setLanguage(java.lang.String language)
          Sets the language for the profile
 void setName(java.lang.String name)
          Sets the name of the profile
 void setProjects(java.util.List<ResourceModel> projects)
          Sets the list of projects attached to the profile
 void setProvided(java.lang.Boolean provided)
          Sets wether the profile ships with Sonar core
 java.lang.String toString()
           
 
Methods inherited from class org.sonar.api.database.BaseIdentifiable
getId, setId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SONAR_WAY_NAME

public static final java.lang.String SONAR_WAY_NAME
The profile key for the embedded profile Sonar Way

See Also:
Constant Field Values

SONAR_WAY_FINDBUGS_NAME

public static final java.lang.String SONAR_WAY_FINDBUGS_NAME
The profile key for the embedded profile Sonar Way with Findbugs

See Also:
Constant Field Values

SUN_CONVENTIONS_NAME

public static final java.lang.String SUN_CONVENTIONS_NAME
The profile key for the embedded profile Sun checks

See Also:
Constant Field Values
Constructor Detail

RulesProfile

public RulesProfile()
Default constructor


RulesProfile

public RulesProfile(java.lang.String name,
                    java.lang.String language)

Creates a profile of rules with empty active rules, empty alerts and empty project lists.

Parameters:
name - the name to be used to access the profile, will be used as a key and display name
language - the language to which this profile applies

RulesProfile

public RulesProfile(java.lang.String name,
                    java.lang.String language,
                    boolean defaultProfile,
                    boolean provided)

Creates a profile of rules with empty active rules, empty alerts and empty project lists.

Parameters:
name - the name to be used to access the profile, will be used as a key and display name
language - the language to which this profile applies
defaultProfile - whether this is the default profile for the language
provided - whether the profile is embarked in core Sonar
Method Detail

getName

public java.lang.String getName()
Returns:
the name of the profile

setName

public void setName(java.lang.String name)
Sets the name of the profile


getActiveRules

public java.util.List<ActiveRule> getActiveRules()
Returns:
the list of active rules

setActiveRules

public void setActiveRules(java.util.List<ActiveRule> activeRules)
Sets the list of active rules


getDefaultProfile

public java.lang.Boolean getDefaultProfile()
Returns:
whether this is the default profile for the language

setDefaultProfile

public void setDefaultProfile(java.lang.Boolean defaultProfile)
Sets whether this is the default profile for the language


getProvided

public java.lang.Boolean getProvided()
Returns:
whether the profile ships with Sonar core

setProvided

public void setProvided(java.lang.Boolean provided)
Sets wether the profile ships with Sonar core


getLanguage

public java.lang.String getLanguage()
Returns:
the language of the profile

setLanguage

public void setLanguage(java.lang.String language)
Sets the language for the profile


getAlerts

public java.util.List<Alert> getAlerts()
Returns:
the list of alerts defined in the profile

setAlerts

public void setAlerts(java.util.List<Alert> alerts)
Sets the list of alerts for the profile


getProjects

public java.util.List<ResourceModel> getProjects()
Returns:
the list of projects attached to the profile

setProjects

public void setProjects(java.util.List<ResourceModel> projects)
Sets the list of projects attached to the profile


getActiveRules

public java.util.List<ActiveRule> getActiveRules(RulePriority priority)
Returns:
the list of active rules for a given priority

getActiveRulesByPlugin

public java.util.List<ActiveRule> getActiveRulesByPlugin(java.lang.String pluginKey)
Returns:
the list of active rules for a given plugin

getActiveRule

public ActiveRule getActiveRule(java.lang.String pluginKey,
                                java.lang.String ruleKey)
Returns:
an active rule from a plugin key and a rule key if the rule is activated, null otherwise

getActiveRule

public ActiveRule getActiveRule(Rule rule)
THIS METHOD SHOULD NOT BE USED AS CURRENTLY THE PLUGIN KEY CAN NOT BE DETERMINED

Returns:
an active rule from a rule key if the rule is activated, null otherwise

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009-2010 SonarSource SA. All Rights Reserved.