diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2014-01-18 00:21:22 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2014-01-18 00:21:22 +0100 |
commit | 87ecfc8080ef957bc66e47f8165d3ab3f5508c40 (patch) | |
tree | 0d3261dc2312be16253a700d07c6f127d2c5fc2e /sonar-deprecated/src | |
parent | 0f68d9e9b1e39fc11d5abcc70e17e144c521b610 (diff) | |
download | sonarqube-87ecfc8080ef957bc66e47f8165d3ab3f5508c40.tar.gz sonarqube-87ecfc8080ef957bc66e47f8165d3ab3f5508c40.zip |
Remove org.sonar.api.database.daos.MeasuresDao, deprecated since v2.3 and move some deprecated classes from sonar-plugin-api to sonar-deprecated
Diffstat (limited to 'sonar-deprecated/src')
4 files changed, 216 insertions, 79 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java b/sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java deleted file mode 100644 index 866bc0db8c2..00000000000 --- a/sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2013 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.database.daos; - -import org.sonar.api.measures.Metric; - -import java.util.Collection; -import java.util.List; - -/** - * @deprecated since 2.3 - */ -@Deprecated -public class MeasuresDao { - - private org.sonar.jpa.dao.MeasuresDao target; - - public MeasuresDao(org.sonar.jpa.dao.MeasuresDao target) { - this.target = target; - } - - public Metric getMetric(Metric metric) { - return target.getMetric(metric); - } - - public List<Metric> getMetrics(List<Metric> metrics) { - return target.getMetrics(metrics); - } - - public Metric getMetric(String metricName) { - return target.getMetric(metricName); - } - - public Collection<Metric> getMetrics() { - return target.getMetrics(); - } - - public Collection<Metric> getEnabledMetrics() { - return target.getEnabledMetrics(); - } - - public Collection<Metric> getUserDefinedMetrics() { - return target.getUserDefinedMetrics(); - } - - public void disableAutomaticMetrics() { - target.disableAutomaticMetrics(); - } - - public void registerMetrics(Collection<Metric> metrics) { - target.registerMetrics(metrics); - } - - public void persistMetric(Metric metric) { - target.persistMetric(metric); - } - - public void disabledMetrics(Collection<Metric> metrics) { - target.disabledMetrics(metrics); - } - -} diff --git a/sonar-deprecated/src/main/java/org/sonar/api/i18n/RuleI18n.java b/sonar-deprecated/src/main/java/org/sonar/api/i18n/RuleI18n.java new file mode 100644 index 00000000000..aaba70c143e --- /dev/null +++ b/sonar-deprecated/src/main/java/org/sonar/api/i18n/RuleI18n.java @@ -0,0 +1,152 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2013 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.api.i18n; + +import org.sonar.api.BatchComponent; +import org.sonar.api.ServerComponent; +import org.sonar.api.rules.Rule; + +import javax.annotation.CheckForNull; + +import java.util.Locale; + +/** + * {@link I18n}-companion component that provides translation facilities for rule names, descriptions and parameter names. + * + * @since 3.2 + * @deprecated in 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885 + */ +@Deprecated +public interface RuleI18n extends ServerComponent, BatchComponent { + + /** + * Returns the localized name of the rule identified by its repository key and rule key. + * <br> + * 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. + * + * @param repositoryKey the repository key + * @param ruleKey the rule key + * @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). + * It the default name is not found, then the rule name is returned. + * + * @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). + * As a rule must have a description (this is a constraint in Sonar), this method never returns null. + * + * @param repositoryKey the repository key + * @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, + * this method returns null (= if no translation can be found). + * + * @param repositoryKey the repository key + * @param ruleKey the rule key + * @param paramKey the parameter key + * @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); + +} diff --git a/sonar-deprecated/src/main/java/org/sonar/api/web/GwtExtension.java b/sonar-deprecated/src/main/java/org/sonar/api/web/GwtExtension.java new file mode 100644 index 00000000000..2b099ce1ef1 --- /dev/null +++ b/sonar-deprecated/src/main/java/org/sonar/api/web/GwtExtension.java @@ -0,0 +1,31 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2013 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.api.web; + +import org.sonar.api.ServerExtension; + +/** + * @since 1.10 + * @deprecated in 3.7. Replaced by Ruby on Rails extensions + */ +@Deprecated +public interface GwtExtension extends ServerExtension { + String getGwtId(); +} diff --git a/sonar-deprecated/src/main/java/org/sonar/api/web/GwtPage.java b/sonar-deprecated/src/main/java/org/sonar/api/web/GwtPage.java new file mode 100644 index 00000000000..558a5717af8 --- /dev/null +++ b/sonar-deprecated/src/main/java/org/sonar/api/web/GwtPage.java @@ -0,0 +1,33 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2013 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.api.web; + +/** + * @since 1.11 + * @deprecated in 3.7. Replaced by Ruby on Rails pages. + */ +@Deprecated +public abstract class GwtPage implements Page, GwtExtension { + + public final String getId() { + return getGwtId(); + } + +} |