From 35e601850139196ab87033667fe02e07ec6361ef Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 25 Apr 2014 12:02:46 +0200 Subject: [PATCH] SONAR-5007 draft of rule objects on server side --- .../java/org/sonar/server/rule2/Rule.java | 66 +++++++++++++++++++ .../org/sonar/server/rule2/RuleParam.java | 33 ++++++++++ .../org/sonar/server/rule2/package-info.java | 23 +++++++ 3 files changed, 122 insertions(+) create mode 100644 sonar-server/src/main/java/org/sonar/server/rule2/Rule.java create mode 100644 sonar-server/src/main/java/org/sonar/server/rule2/RuleParam.java create mode 100644 sonar-server/src/main/java/org/sonar/server/rule2/package-info.java diff --git a/sonar-server/src/main/java/org/sonar/server/rule2/Rule.java b/sonar-server/src/main/java/org/sonar/server/rule2/Rule.java new file mode 100644 index 00000000000..e925ae2b09c --- /dev/null +++ b/sonar-server/src/main/java/org/sonar/server/rule2/Rule.java @@ -0,0 +1,66 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 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.server.rule2; + +import org.sonar.api.rule.RuleKey; +import org.sonar.api.rule.Severity; +import org.sonar.api.server.debt.DebtRemediationFunction; + +import javax.annotation.CheckForNull; +import java.util.Date; +import java.util.List; + +/** + * @since 4.4 + */ +public interface Rule { + + RuleKey key(); + + String language(); + + String name(); + + String description(); + + Severity severity(); + + String status(); + + boolean template(); + + List tags(); + + List params(); + + @CheckForNull + String debtCharacteristicKey(); + + @CheckForNull + String debtSubCharacteristicKey(); + + @CheckForNull + DebtRemediationFunction debtRemediationFunction(); + + Date createdAt(); + + Date updatedAt(); + +} diff --git a/sonar-server/src/main/java/org/sonar/server/rule2/RuleParam.java b/sonar-server/src/main/java/org/sonar/server/rule2/RuleParam.java new file mode 100644 index 00000000000..09df249d9e8 --- /dev/null +++ b/sonar-server/src/main/java/org/sonar/server/rule2/RuleParam.java @@ -0,0 +1,33 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 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.server.rule2; + +import org.sonar.api.server.rule.RuleParamType; + +public interface RuleParam { + + String key(); + + String description(); + + String defaultValue(); + + RuleParamType type(); +} diff --git a/sonar-server/src/main/java/org/sonar/server/rule2/package-info.java b/sonar-server/src/main/java/org/sonar/server/rule2/package-info.java new file mode 100644 index 00000000000..569e8a86a4b --- /dev/null +++ b/sonar-server/src/main/java/org/sonar/server/rule2/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 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. + */ +@ParametersAreNonnullByDefault +package org.sonar.server.rule2; + +import javax.annotation.ParametersAreNonnullByDefault; -- 2.39.5