diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-09-08 14:49:21 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-09-09 09:50:57 +0200 |
commit | 4fd276fb8febe54800f3f23fe4b815dba0cd8fb4 (patch) | |
tree | 60c1bcc2f314852276f136575790f73a19eac143 /sonar-plugin-api/src | |
parent | 9309b09ba2dedf09df270ec6f64a3ff5b6160cd6 (diff) | |
download | sonarqube-4fd276fb8febe54800f3f23fe4b815dba0cd8fb4.tar.gz sonarqube-4fd276fb8febe54800f3f23fe4b815dba0cd8fb4.zip |
SONAR-6730 Improve javadoc
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java index df3e4f2ce37..daa7821a0d7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java @@ -67,7 +67,7 @@ import org.sonar.api.server.ServerSide; * * MyMeasureComputer underTest = new MyMeasureComputer(); * - * @Test + * {@literal @}Test * public void test_definition() { * TestMeasureComputerDefinitionContext defContext = new TestMeasureComputerDefinitionContext(); * MeasureComputerDefinition def = underTest.define(defContext); @@ -76,7 +76,7 @@ import org.sonar.api.server.ServerSide; * assertThat(def.getOutputMetrics()).containsOnly("my_new_metric"); * } * - * @Test + * {@literal @}Test * public void sum_ncloc_and_issues() { * TestMeasureComputerContext context = new TestMeasureComputerContext(underTest); * context.addMeasure("ncloc", 2); @@ -119,14 +119,26 @@ public interface MeasureComputer { Set<String> getOutputMetrics(); interface Builder { + /** - * Input metrics can be empty (for instance when only issues are needed) + * List of metric keys of the measures that will be loaded by this computer. It can be empty (for instance when only issues are needed). + * A metric must be either a {@link org.sonar.api.measures.CoreMetrics} or a metric provided by {@link org.sonar.api.measures.Metrics} + * * @throws NullPointerException if inputMetrics is null * @throws NullPointerException if the metrics contains a {@code null} * */ Builder setInputMetrics(String... inputMetrics); /** + * List of metric keys of the measures that can be added by this computer. At least one metric key must be defined. + * + * At runtime, the following conditions will be validated : + * <ul> + * <li>A metric must be defined by {@link org.sonar.api.measures.Metrics}</li> + * <li>A metric cannot be a {@link org.sonar.api.measures.CoreMetrics}</li> + * <li>A metric must be generated by only one {@link MeasureComputer}</li> + * </ul> + * * @throws NullPointerException if outputMetrics is null * @throws IllegalArgumentException if there's not at least one output metrics * @throws NullPointerException if the metrics contains a {@code null} |