summaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-09-14 15:49:43 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-09-15 15:42:13 +0200
commit9d80c9e921a1927b8496af23dbf51f08fc762d23 (patch)
tree84b0edf32d37de87b6b6a7c0aeff01cd9f42eb14 /sonar-plugin-api
parent53620de6df74d058e73a512da0f2c4143340670d (diff)
downloadsonarqube-9d80c9e921a1927b8496af23dbf51f08fc762d23.tar.gz
sonarqube-9d80c9e921a1927b8496af23dbf51f08fc762d23.zip
SONAR-6407 Missing javadoc on profileImporter and profileExporter
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java14
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java12
2 files changed, 26 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java
index 3e1dfa846d8..22a458c3751 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java
@@ -28,6 +28,8 @@ import org.sonar.api.batch.ScannerSide;
import org.sonar.api.server.ServerSide;
/**
+ * Export quality profile rules to a file
+ *
* @since 2.3
*/
@ScannerSide
@@ -45,6 +47,11 @@ public abstract class ProfileExporter {
this.name = name;
}
+ /**
+ * Export activated rule from a quality profile to a writer
+ *
+ * Note that the quality profile can contain some rules from other plugins. It should not fail in this case.
+ */
public abstract void exportProfile(RulesProfile profile, Writer writer);
public String getKey() {
@@ -65,6 +72,10 @@ public abstract class ProfileExporter {
return this;
}
+ /**
+ * Set the list of languages supported
+ * An empty value means that it will be available for every languages.
+ */
protected final ProfileExporter setSupportedLanguages(String... languages) {
supportedLanguages = (languages != null) ? languages : new String[0];
return this;
@@ -74,6 +85,9 @@ public abstract class ProfileExporter {
return mimeType;
}
+ /**
+ * Set the mime type of the exported file
+ */
public final ProfileExporter setMimeType(String s) {
if (StringUtils.isNotBlank(s)) {
this.mimeType = s;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java
index e1f65d3b68b..e74e25351ef 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java
@@ -27,6 +27,8 @@ import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.ValidationMessages;
/**
+ * Create a quality profile from an external rules file.
+ *
* @since 2.3
*/
@ServerSide
@@ -42,6 +44,12 @@ public abstract class ProfileImporter {
this.importerName = name;
}
+ /**
+ * Import the profile from a reader.
+ *
+ * {@link ValidationMessages#warnings} can be used to return some warnings to the user, for instance when some rules doesn't exist.
+ * {@link ValidationMessages#errors} can be used when an unrecoverable error is generating during import. No quality profile will be created.
+ */
public abstract RulesProfile importProfile(Reader reader, ValidationMessages messages);
public String getKey() {
@@ -62,6 +70,10 @@ public abstract class ProfileImporter {
return this;
}
+ /**
+ * Set the list of languages supported
+ * An empty value means that it will be available for every languages.
+ */
protected final ProfileImporter setSupportedLanguages(String... languages) {
supportedLanguages = (languages != null) ? languages : new String[0];
return this;