1 package com.guinetik.terminaljavadocs.plugin;
2
3 /**
4 * Data transfer object representing a Maven module's report metadata.
5 *
6 * <p>
7 * Used by {@link GenerateLandingPagesMojo} to collect information about modules
8 * that have generated reports (coverage, xref) and render them into landing pages.
9 *
10 * <p>
11 * Example usage:
12 * <pre>{@code
13 * ModuleReport report = new ModuleReport(
14 * "my-module",
15 * "Core utilities library",
16 * "my-module"
17 * );
18 * // Use in template: report.getArtifactId() -> "my-module"
19 * }</pre>
20 *
21 * @see GenerateLandingPagesMojo
22 */
23 public class ModuleReport {
24
25 private final String artifactId;
26 private final String description;
27 private final String relativePath;
28
29 /**
30 * Creates a new module report with the specified metadata.
31 *
32 * @param artifactId the Maven artifact ID of the module (e.g., "my-module")
33 * @param description the module's description from pom.xml, may be {@code null}
34 * @param relativePath the relative path from the landing page to this module's reports
35 */
36 public ModuleReport(String artifactId, String description, String relativePath) {
37 this.artifactId = artifactId;
38 this.description = description;
39 this.relativePath = relativePath;
40 }
41
42 /**
43 * Returns the Maven artifact ID of this module.
44 *
45 * @return the artifact ID, never {@code null}
46 */
47 public String getArtifactId() {
48 return artifactId;
49 }
50
51 /**
52 * Returns the module's description from its pom.xml.
53 *
54 * @return the description, or {@code null} if not specified in the POM
55 */
56 public String getDescription() {
57 return description;
58 }
59
60 /**
61 * Returns the relative path from the landing page to this module's report directory.
62 *
63 * <p>
64 * This path is used to construct links in the generated landing pages,
65 * e.g., {@code ./my-module/jacoco/index.html}.
66 *
67 * @return the relative path to the module's reports
68 */
69 public String getRelativePath() {
70 return relativePath;
71 }
72 }