summaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-11-29 12:05:54 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2013-11-29 12:06:18 +0100
commit2f4e11fb0c0bd16ccb2d8c35292df3a86d879778 (patch)
tree07159b1e7f10d1d1046762a0d293e983f305314b /sonar-plugin-api
parente820ac79c6365cf3b86d9a028cddeba64657db94 (diff)
downloadsonarqube-2f4e11fb0c0bd16ccb2d8c35292df3a86d879778.tar.gz
sonarqube-2f4e11fb0c0bd16ccb2d8c35292df3a86d879778.zip
SONAR-4885 Stop supporting the internationalization of rule descriptions and titles
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java59
1 files changed, 58 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
index 9b06cee3180..2970be3f0b1 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
@@ -42,13 +42,28 @@ public interface RuleI18n extends ServerComponent, BatchComponent {
*
* @param repositoryKey the repository key
* @param ruleKey the rule key
- * @param locale the locale to translate into
+ * @param locale not used
* @return the translated name of the rule, or the default English one if the given locale is not supported, or null
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
*/
+ @Deprecated
@CheckForNull
String getName(String repositoryKey, String ruleKey, Locale locale);
/**
+ * Returns the name of the rule identified by its repository key and rule key.
+ * <br>
+ * This method could return null if no default name found. This is the cause for instance the copies rules.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @return the nullable name of the rule
+ * @since 4.1
+ */
+ @CheckForNull
+ String getName(String repositoryKey, String ruleKey);
+
+ /**
* Returns the localized name or the name of the rule.
* <br>
* If the name is not found in the given locale, then the default name is returned (the English one).
@@ -57,11 +72,25 @@ public interface RuleI18n extends ServerComponent, BatchComponent {
* @param rule the rule
* @param locale the locale to translate into
* @return the translated name of the rule, or the default English one if the given locale is not supported, or the rule name.
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
*/
+ @Deprecated
@CheckForNull
String getName(Rule rule, Locale locale);
/**
+ * Returns the name of the rule.
+ * <br>
+ * It the default name is not found, then the rule name is returned.
+ *
+ * @param rule the rule
+ * @return the nullable name of the rule
+ * @since 4.1
+ */
+ @CheckForNull
+ String getName(Rule rule);
+
+ /**
* Returns the localized description of the rule identified by its repository key and rule key.
* <br>
* If the description is not found in the given locale, then the default description is returned (the English one).
@@ -71,10 +100,24 @@ public interface RuleI18n extends ServerComponent, BatchComponent {
* @param ruleKey the rule key
* @param locale the locale to translate into
* @return the translated description of the rule, or the default English one if the given locale is not supported
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
*/
+ @Deprecated
String getDescription(String repositoryKey, String ruleKey, Locale locale);
/**
+ * Returns the description of the rule identified by its repository key and rule key.
+ * <br>
+ * As a rule must have a description (this is a constraint in SonarQube), this method never returns null.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @return the description of the rule
+ * @since 4.1
+ */
+ String getDescription(String repositoryKey, String ruleKey);
+
+ /**
* Returns the localized name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
* <br>
* If the name is not found in the given locale, then the English translation is searched and return if found. Otherwise,
@@ -86,8 +129,22 @@ public interface RuleI18n extends ServerComponent, BatchComponent {
* @param locale the locale to translate into
* @return 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.
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
*/
+ @Deprecated
@CheckForNull
String getParamDescription(String repositoryKey, String ruleKey, String paramKey, Locale locale);
+ /**
+ * Returns the name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @param paramKey the parameter key
+ * @return the nullable name of the rule parameter
+ * @since 4.1
+ */
+ @CheckForNull
+ String getParamDescription(String repositoryKey, String ruleKey, String paramKey);
+
}