]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6730 Improve javadoc
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 8 Sep 2015 12:49:21 +0000 (14:49 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 9 Sep 2015 07:50:57 +0000 (09:50 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java

index df3e4f2ce37797d08c157e509d21c4694f7b799f..daa7821a0d75006f4f63c6156dfdfa092f8fb48f 100644 (file)
@@ -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}