Class GoalReportBuilder
java.lang.Object
network.ike.plugin.support.GoalReportBuilder
Fluent builder for the body of an IKE goal report.
GoalReport owns the report frame — the
# <prefix>:<goal> title and the timestamp line. This builder
owns the body: the sections, paragraphs, bullet lists,
tables, and fenced code blocks beneath that frame. Routing every
report through one builder keeps section depth, table syntax, and
spacing identical across goals instead of each mojo hand-rolling its
own StringBuilder (IKE-Network/ike-issues#408).
Methods return this so a report reads as a single
chained expression:
String body = new GoalReportBuilder()
.section("Status")
.paragraph("3 cloned, 1 not cloned.")
.table(List.of("Subproject", "Branch"),
List.of(new String[]{"ike-docs", "main"}))
.build();
The builder emits GitHub-flavoured Markdown. Section headings use
## — one level below the # title GoalReport
prepends. Pass the build() result to
AbstractGoalMojo.writeReport (ike plugin) or
AbstractWorkspaceMojo.writeReport (ws plugin).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Render the accumulated body as a Markdown string.Append a single bullet-list item (- text).Append a fenced code block.Append a paragraph followed by a blank line.Append a pre-rendered Markdown fragment verbatim — the escape hatch for content a primitive does not cover (e.g.Append a section heading (## title).Append a GitHub-flavoured Markdown table.
-
Constructor Details
-
GoalReportBuilder
public GoalReportBuilder()Creates an empty report-body builder.
-
-
Method Details
-
section
Append a section heading (## title).- Parameters:
title- the section title- Returns:
- this builder
-
paragraph
Append a paragraph followed by a blank line.- Parameters:
text- the paragraph text- Returns:
- this builder
-
bullet
Append a single bullet-list item (- text). Consecutive calls build a contiguous list.- Parameters:
text- the bullet text- Returns:
- this builder
-
table
Append a GitHub-flavoured Markdown table. A no-op whenrowsis empty — an empty table is never emitted.- Parameters:
headers- column headers (defines the column count)rows- row cells; each array should match the header count (shorter rows are padded, longer rows truncated, so a ragged caller cannot break the table grid)- Returns:
- this builder
-
codeBlock
Append a fenced code block.- Parameters:
language- the fence language hint (e.g."dot"); may be empty for a plain fencecontent- the block content (a trailing newline is added if absent)- Returns:
- this builder
-
raw
Append a pre-rendered Markdown fragment verbatim — the escape hatch for content a primitive does not cover (e.g.DriftReport.toMarkdown()).- Parameters:
markdown- the Markdown fragment- Returns:
- this builder
-
build
Render the accumulated body as a Markdown string.- Returns:
- the report body (no title or timestamp — those are
added by
GoalReport)
-