]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 draft of rule objects on server side
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 25 Apr 2014 10:02:46 +0000 (12:02 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 25 Apr 2014 10:02:56 +0000 (12:02 +0200)
sonar-server/src/main/java/org/sonar/server/rule2/Rule.java [new file with mode: 0644]
sonar-server/src/main/java/org/sonar/server/rule2/RuleParam.java [new file with mode: 0644]
sonar-server/src/main/java/org/sonar/server/rule2/package-info.java [new file with mode: 0644]

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 (file)
index 0000000..e925ae2
--- /dev/null
@@ -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<String> tags();
+
+  List<RuleParam> 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 (file)
index 0000000..09df249
--- /dev/null
@@ -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 (file)
index 0000000..569e8a8
--- /dev/null
@@ -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;