aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-05-18 15:10:10 +0200
committerDavid Gageot <david@gageot.net>2012-05-22 08:00:03 +0200
commit67119fa339119ccdd0cd22feb9ac70af73531b21 (patch)
treeda757fec5745dbaeb5ecbcf6bbe9b5747a961b29 /sonar-plugin-api
parentbcd5c9f345d5c5e619034f2806e87b260544f75e (diff)
downloadsonarqube-67119fa339119ccdd0cd22feb9ac70af73531b21.tar.gz
sonarqube-67119fa339119ccdd0cd22feb9ac70af73531b21.zip
SONAR-3016 Draft of new extension point for filter template
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java40
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/FilterTemplate.java42
2 files changed, 82 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java
new file mode 100644
index 00000000000..5c65c30febf
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java
@@ -0,0 +1,40 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2012 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.api.web;
+
+/**
+ * Definition of a filter.
+ * <p/>
+ * Its name can be retrieved using the i18n mechanism, using the keys "dashboard.&lt;id&gt;.name".
+ *
+ * @since 3.1
+ */
+public class Filter {
+ private Filter() {
+ // The factory method should be used
+ }
+
+ /**
+ * Creates a new {@link Filter}.
+ */
+ public static Filter create() {
+ return new Filter();
+ }
+}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/FilterTemplate.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/FilterTemplate.java
new file mode 100644
index 00000000000..79e6ca7b43a
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/FilterTemplate.java
@@ -0,0 +1,42 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2012 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.api.web;
+
+import org.sonar.api.ServerExtension;
+
+/**
+ * This extension point must be implemented to define a new filter.
+ *
+ * @since 3.1
+ */
+public abstract class FilterTemplate implements ServerExtension {
+
+ /**
+ * Returns the {@link Filter} object that represents the filter to use.
+ *
+ * @return the filter
+ */
+ public abstract Filter createFilter();
+
+ /**
+ * Filter name
+ */
+ public abstract String getName();
+}