aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-01-19 23:00:34 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-01-19 23:00:34 +0100
commit1ab2475003835b71ff44b3652691c538059db699 (patch)
tree4493d65fef786919f285ccfcdbb45858592149c7
parent5b4a5f39b3081312c37e9cf436aee6b04f8995d0 (diff)
downloadsonarqube-1ab2475003835b71ff44b3652691c538059db699.tar.gz
sonarqube-1ab2475003835b71ff44b3652691c538059db699.zip
add the classes org.sonar.api.resources.Qualifiers and Scopes
-rw-r--r--sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java38
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Scopes.java53
3 files changed, 93 insertions, 2 deletions
diff --git a/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java b/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java
index 4a2b9d7086b..537fba56985 100644
--- a/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java
+++ b/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java
@@ -64,12 +64,12 @@ public final class JavaClass extends Resource {
@Override
public String getScope() {
- return ResourceScopes.TYPE;
+ return Scopes.TYPE;
}
@Override
public String getQualifier() {
- return ResourceQualifiers.CLASS;
+ return Qualifiers.CLASS;
}
@Override
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java
new file mode 100644
index 00000000000..f5f87b2161a
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java
@@ -0,0 +1,38 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * 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.resources;
+
+public interface Qualifiers {
+
+ String VIEW = "VW";
+ String SUBVIEW = "SVW";
+ String LIB = "LIB";
+ String PROJECT = "TRK";
+ String MODULE = "BRC";
+ String PACKAGE = "PAC";
+ String DIRECTORY = "DIR";
+ String FILE = "FIL";
+ String CLASS = "CLA";
+ String METHOD = "MET";
+ String FIELD = "FLD";
+
+ // ugly, should be replaced by a nature
+ String UNIT_TEST_CLASS = "UTS";
+} \ No newline at end of file
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Scopes.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Scopes.java
new file mode 100644
index 00000000000..fc8a29f2bbb
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Scopes.java
@@ -0,0 +1,53 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * 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.resources;
+
+/**
+ * Resource scopes are not extendable by plugins.
+ */
+public interface Scopes {
+ /**
+ * For example view, subview, project, module or library. Persisted in database.
+ */
+ String PROJECT = "PRJ";
+
+ /**
+ * For example directory or Java package. Persisted in database.
+ */
+ String NAMESPACE = "DIR";
+
+ /**
+ * For example a Java file. Persisted in database.
+ */
+ String FILE = "FIL";
+
+ /**
+ * For example a Java class or a Java interface. Not persisted in database.
+ */
+ String TYPE = "TYP";
+
+ /**
+ * For example a Java method. Not persisted in database.
+ */
+ String METHOD = "MET";
+
+
+ String[] ORDERED_SCOPES = {PROJECT, NAMESPACE, FILE, TYPE, METHOD};
+}