diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-02-11 10:50:49 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-02-11 10:51:48 +0100 |
commit | 47f2f97a93665db1e619679a31b0d78e0b81818f (patch) | |
tree | b6e0b25552685bbd2d3ba918cf89a8faab78033d /sonar-plugin-api/src | |
parent | d680598734d6e05c5ee5598463e5dc7912bca31c (diff) | |
download | sonarqube-47f2f97a93665db1e619679a31b0d78e0b81818f.tar.gz sonarqube-47f2f97a93665db1e619679a31b0d78e0b81818f.zip |
SONAR-926 Export component path in issues WS search results
Diffstat (limited to 'sonar-plugin-api/src')
3 files changed, 21 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java index b658be87d19..064f51f37fc 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java @@ -22,6 +22,11 @@ package org.sonar.api.component; public interface Component<C extends Component> { String key(); + /** + * @since 4.2 + */ + String path(); + String name(); String longName(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java index 0e6f2b7fe95..428c17a5a4c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java @@ -23,6 +23,7 @@ import org.sonar.api.component.SourceFile; public class MockSourceFile implements SourceFile { private String key; + private String path; private String qualifier; private String language; private String name; @@ -40,6 +41,16 @@ public class MockSourceFile implements SourceFile { return this; } + @Override + public String path() { + return path; + } + + public MockSourceFile setPath(String path) { + this.path = path; + return this; + } + public String qualifier() { return qualifier; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java index a4aaf28b342..2119c04a1f2 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java @@ -503,6 +503,11 @@ public class Project extends Resource implements Component { } @Override + public String path() { + return getPath(); + } + + @Override public String longName() { return getLongName(); } |