org.sonar.api.i18n
Interface RuleI18n

All Superinterfaces:
BatchComponent, ServerComponent

Deprecated. in 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885

@Deprecated
public interface RuleI18n
extends ServerComponent, BatchComponent

I18n-companion component that provides translation facilities for rule names, descriptions and parameter names.

Since:
3.2

Method Summary
 String getDescription(String repositoryKey, String ruleKey)
          Deprecated. Returns the description of the rule identified by its repository key and rule key.
 String getDescription(String repositoryKey, String ruleKey, Locale locale)
          Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
 String getName(Rule rule)
          Deprecated. Returns the name of the rule.
 String getName(Rule rule, Locale locale)
          Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
 String getName(String repositoryKey, String ruleKey)
          Deprecated. Returns the name of the rule identified by its repository key and rule key.
 String getName(String repositoryKey, String ruleKey, Locale locale)
          Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
 String getParamDescription(String repositoryKey, String ruleKey, String paramKey)
          Deprecated. Returns the name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
 String getParamDescription(String repositoryKey, String ruleKey, String paramKey, Locale locale)
          Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
 

Method Detail

getName

@Deprecated
@CheckForNull
String getName(String repositoryKey,
                                       String ruleKey,
                                       Locale locale)
Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885

Returns the localized name of the rule identified by its repository key and rule key.
If the name is not found in the given locale, then the default name is returned (the English one). This method could return null if no default name found. This is the cause for instance the copies rules.

Parameters:
repositoryKey - the repository key
ruleKey - the rule key
locale - not used
Returns:
the translated name of the rule, or the default English one if the given locale is not supported, or null

getName

@CheckForNull
String getName(String repositoryKey,
                            String ruleKey)
Deprecated. 
Returns the name of the rule identified by its repository key and rule key.
This method could return null if no default name found. This is the cause for instance the copies rules.

Parameters:
repositoryKey - the repository key
ruleKey - the rule key
Returns:
the nullable name of the rule
Since:
4.1

getName

@Deprecated
@CheckForNull
String getName(Rule rule,
                                       Locale locale)
Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885

Returns the localized name or the name of the rule.
If the name is not found in the given locale, then the default name is returned (the English one). It the default name is not found, then the rule name is returned.

Parameters:
rule - the rule
locale - the locale to translate into
Returns:
the translated name of the rule, or the default English one if the given locale is not supported, or the rule name.

getName

@CheckForNull
String getName(Rule rule)
Deprecated. 
Returns the name of the rule.
It the default name is not found, then the rule name is returned.

Parameters:
rule - the rule
Returns:
the nullable name of the rule
Since:
4.1

getDescription

@Deprecated
String getDescription(String repositoryKey,
                                 String ruleKey,
                                 Locale locale)
Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885

Returns the localized description of the rule identified by its repository key and rule key.
If the description is not found in the given locale, then the default description is returned (the English one). As a rule must have a description (this is a constraint in Sonar), this method never returns null.

Parameters:
repositoryKey - the repository key
ruleKey - the rule key
locale - the locale to translate into
Returns:
the translated description of the rule, or the default English one if the given locale is not supported

getDescription

String getDescription(String repositoryKey,
                      String ruleKey)
Deprecated. 
Returns the description of the rule identified by its repository key and rule key.
As a rule must have a description (this is a constraint in SonarQube), this method never returns null.

Parameters:
repositoryKey - the repository key
ruleKey - the rule key
Returns:
the description of the rule
Since:
4.1

getParamDescription

@Deprecated
@CheckForNull
String getParamDescription(String repositoryKey,
                                                   String ruleKey,
                                                   String paramKey,
                                                   Locale locale)
Deprecated. since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885

Returns the localized name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
If the name is not found in the given locale, then the English translation is searched and return if found. Otherwise, this method returns null (= if no translation can be found).

Parameters:
repositoryKey - the repository key
ruleKey - the rule key
paramKey - the parameter key
locale - the locale to translate into
Returns:
the translated name of the rule parameter, or the default English one if the given locale is not supported, or null if no translation can be found.

getParamDescription

@CheckForNull
String getParamDescription(String repositoryKey,
                                        String ruleKey,
                                        String paramKey)
Deprecated. 
Returns the name of the rule parameter identified by the rules's key and repository key, and by the parameter key.

Parameters:
repositoryKey - the repository key
ruleKey - the rule key
paramKey - the parameter key
Returns:
the nullable name of the rule parameter
Since:
4.1


Copyright © 2009–2015 SonarSource. All rights reserved.