Interface RuleI18n


  • @Deprecated
    @ServerSide
    @ComputeEngineSide
    public interface RuleI18n
    Deprecated.
    in 4.1. Rules are not localized anymore. See http://jira.sonarsource.com/browse/SONAR-4885
    I18n-companion component that provides translation facilities for rule names, descriptions and parameter names.
    Since:
    3.2
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String getDescription​(java.lang.String repositoryKey, java.lang.String ruleKey)
      Deprecated.
      Returns the description of the rule identified by its repository key and rule key.
      java.lang.String getDescription​(java.lang.String repositoryKey, java.lang.String ruleKey, java.util.Locale locale)
      Deprecated.
      since 4.1.
      java.lang.String getName​(java.lang.String repositoryKey, java.lang.String ruleKey)
      Deprecated.
      Returns the name of the rule identified by its repository key and rule key.
      java.lang.String getName​(java.lang.String repositoryKey, java.lang.String ruleKey, java.util.Locale locale)
      Deprecated.
      since 4.1.
      java.lang.String getName​(Rule rule)
      Deprecated.
      Returns the name of the rule.
      java.lang.String getName​(Rule rule, java.util.Locale locale)
      Deprecated.
      since 4.1.
      java.lang.String getParamDescription​(java.lang.String repositoryKey, java.lang.String ruleKey, java.lang.String paramKey)
      Deprecated.
      Returns the name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
      java.lang.String getParamDescription​(java.lang.String repositoryKey, java.lang.String ruleKey, java.lang.String paramKey, java.util.Locale locale)
      Deprecated.
      since 4.1.
    • Method Detail

      • getName

        @Deprecated
        @CheckForNull
        java.lang.String getName​(java.lang.String repositoryKey,
                                 java.lang.String ruleKey,
                                 java.util.Locale locale)
        Deprecated.
        since 4.1. Rules are not localized anymore. See http://jira.sonarsource.com/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
        java.lang.String getName​(java.lang.String repositoryKey,
                                 java.lang.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
        java.lang.String getName​(Rule rule,
                                 java.util.Locale locale)
        Deprecated.
        since 4.1. Rules are not localized anymore. See http://jira.sonarsource.com/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
        java.lang.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
        java.lang.String getDescription​(java.lang.String repositoryKey,
                                        java.lang.String ruleKey,
                                        java.util.Locale locale)
        Deprecated.
        since 4.1. Rules are not localized anymore. See http://jira.sonarsource.com/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

        java.lang.String getDescription​(java.lang.String repositoryKey,
                                        java.lang.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
        java.lang.String getParamDescription​(java.lang.String repositoryKey,
                                             java.lang.String ruleKey,
                                             java.lang.String paramKey,
                                             java.util.Locale locale)
        Deprecated.
        since 4.1. Rules are not localized anymore. See http://jira.sonarsource.com/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
        java.lang.String getParamDescription​(java.lang.String repositoryKey,
                                             java.lang.String ruleKey,
                                             java.lang.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