Skip to content

Commit ca71a8a

Browse files
authored
docs(javadoc): make document.* public API doclint-clean (#130)
Clear every doclint warning on the public canonical surface (com.demcha.compose.document.*) so `mvn javadoc:javadoc` (doclint=all) runs warning-free. Scope was far larger than first visible: javadoc's default -Xmaxwarns=100 cap surfaced only ~100 warnings, but the true count was 929 across 142 files / 28 packages (raised the cap to enumerate the full set, then reverted). Mix: 471 no-@param, 191 no-@return, 205 no-comment, 35 no-main-description, 16 use-of-default-constructor, 9 @deprecated-in- package-info, 2 no-@throws. Additive Javadoc only, with two sanctioned, behaviour-neutral exceptions: - 16 explicit no-arg constructors in layout/definitions/* — documents the otherwise-synthesised public default constructor (identical behaviour); the repo-idiomatic fix for doclint's "use of default constructor". - removal of the @deprecated block-tags doclint forbids in 9 package-info files (the @deprecated annotation + prose body already carry the notice). No public or runtime behaviour change. Verified: javadoc:javadoc is warning-clean under doclint=all (real CI config) and the full suite is green (1060 tests, 0 failures, 0 errors). Follows cycle 1.6.9 Track N (PR #128 widened javadoc validation to testing.*); these document.* gaps predate that work.
1 parent f29ec55 commit ca71a8a

143 files changed

Lines changed: 2448 additions & 91 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ Housekeeping cycle plus the public pixel-level visual-regression API (Track N).
2828
pixel-vs-semantic guidance, the `PdfVisualRegression` API, approve mode,
2929
baseline layout, and cross-platform tolerance calibration.
3030
- README "Which API should I use?" gains a pixel-level visual-regression row.
31+
- **Made the entire `com.demcha.compose.document.*` public API Javadoc
32+
doclint-clean.** Added the missing `@param` / `@return` / `@throws` tags and
33+
element descriptions across 142 files so `mvn javadoc:javadoc`
34+
(`doclint=all`) runs warning-free. Java's default `-Xmaxwarns=100` cap had
35+
masked ~90% of the gaps (true count: 929 warnings, not the ~100 first
36+
visible). Additive Javadoc only — no behaviour change; the only code
37+
additions are 16 behaviour-neutral no-arg constructors in
38+
`layout/definitions/*` (documenting the otherwise-synthesised public default
39+
constructor) and removal of the `@deprecated` block-tags `doclint` forbids in
40+
`package-info.java` (the `@Deprecated` annotation + prose body already carry
41+
the notice).
3142

3243
### Build
3344

src/main/java/com/demcha/compose/document/api/DocumentSession.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ public DocumentSession metadata(DocumentMetadata metadata) {
405405
}
406406

407407
/**
408+
* @param options legacy PDF metadata options, or {@code null} to clear
409+
* @return this session
408410
* @deprecated since 1.6.0, removal in v2.0; prefer the canonical
409411
* {@link #metadata(DocumentMetadata)}.
410412
*/
@@ -430,6 +432,8 @@ public DocumentSession watermark(DocumentWatermark watermark) {
430432
}
431433

432434
/**
435+
* @param options legacy PDF watermark options, or {@code null} to clear
436+
* @return this session
433437
* @deprecated since 1.6.0, removal in v2.0; prefer the canonical
434438
* {@link #watermark(DocumentWatermark)}.
435439
*/
@@ -455,6 +459,8 @@ public DocumentSession protect(DocumentProtection protection) {
455459
}
456460

457461
/**
462+
* @param options legacy PDF protection options, or {@code null} to clear
463+
* @return this session
458464
* @deprecated since 1.6.0, removal in v2.0; prefer the canonical
459465
* {@link #protect(DocumentProtection)}.
460466
*/
@@ -479,6 +485,8 @@ public DocumentSession header(DocumentHeaderFooter header) {
479485
}
480486

481487
/**
488+
* @param options legacy PDF header/footer options
489+
* @return this session
482490
* @deprecated since 1.6.0, removal in v2.0; prefer the canonical
483491
* {@link #header(DocumentHeaderFooter)}.
484492
*/
@@ -503,6 +511,8 @@ public DocumentSession footer(DocumentHeaderFooter footer) {
503511
}
504512

505513
/**
514+
* @param options legacy PDF header/footer options
515+
* @return this session
506516
* @deprecated since 1.6.0, removal in v2.0; prefer the canonical
507517
* {@link #footer(DocumentHeaderFooter)}.
508518
*/

src/main/java/com/demcha/compose/document/api/PageBackgroundFill.java

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public record PageBackgroundFill(double xRatio,
5252
double heightRatio,
5353
DocumentColor color) {
5454

55+
/** Validates the ratio bounds and that the fill color is non-null. */
5556
public PageBackgroundFill {
5657
Objects.requireNonNull(color, "color");
5758
if (xRatio < 0.0 || xRatio > 1.0) {
@@ -72,60 +73,118 @@ public record PageBackgroundFill(double xRatio,
7273
}
7374
}
7475

75-
/** Full-page fill, equivalent to the legacy single-color page background. */
76+
/**
77+
* Full-page fill, equivalent to the legacy single-color page background.
78+
*
79+
* @param color fill color (required)
80+
* @return a {@code PageBackgroundFill} that covers the entire page
81+
*/
7682
public static PageBackgroundFill fullPage(DocumentColor color) {
7783
return new PageBackgroundFill(0.0, 0.0, 1.0, 1.0, color);
7884
}
7985

80-
/** Full-height column at the left page edge, with width = ratio of page width. */
86+
/**
87+
* Full-height column at the left page edge, with width = ratio of page width.
88+
*
89+
* @param widthRatio width as a fraction of the canvas width (0..1]
90+
* @param color fill color (required)
91+
* @return a {@code PageBackgroundFill} spanning the full page height at the left edge
92+
*/
8193
public static PageBackgroundFill leftColumn(double widthRatio,
8294
DocumentColor color) {
8395
return new PageBackgroundFill(0.0, 0.0, widthRatio, 1.0, color);
8496
}
8597

86-
/** Full-height column at the right page edge, with width = ratio of page width. */
98+
/**
99+
* Full-height column at the right page edge, with width = ratio of page width.
100+
*
101+
* @param widthRatio width as a fraction of the canvas width (0..1]
102+
* @param color fill color (required)
103+
* @return a {@code PageBackgroundFill} spanning the full page height at the right edge
104+
*/
87105
public static PageBackgroundFill rightColumn(double widthRatio,
88106
DocumentColor color) {
89107
return new PageBackgroundFill(1.0 - widthRatio, 0.0,
90108
widthRatio, 1.0, color);
91109
}
92110

93-
/** Full-height column at an arbitrary horizontal offset. */
111+
/**
112+
* Full-height column at an arbitrary horizontal offset.
113+
*
114+
* @param xRatio left edge of the column: 0.0 = left edge, 1.0 = right edge
115+
* @param widthRatio width as a fraction of the canvas width (0..1]
116+
* @param color fill color (required)
117+
* @return a {@code PageBackgroundFill} spanning the full page height from {@code xRatio}
118+
*/
94119
public static PageBackgroundFill column(double xRatio,
95120
double widthRatio,
96121
DocumentColor color) {
97122
return new PageBackgroundFill(xRatio, 0.0, widthRatio, 1.0, color);
98123
}
99124

100-
/** Full-width band flush with the top of the page (height = ratio of page height). */
125+
/**
126+
* Full-width band flush with the top of the page (height = ratio of page height).
127+
*
128+
* @param heightRatio height as a fraction of the canvas height (0..1]
129+
* @param color fill color (required)
130+
* @return a {@code PageBackgroundFill} spanning the full page width at the top edge
131+
*/
101132
public static PageBackgroundFill topBand(double heightRatio,
102133
DocumentColor color) {
103134
return new PageBackgroundFill(0.0, 0.0, 1.0, heightRatio, color);
104135
}
105136

106-
/** Full-width band flush with the bottom of the page (height = ratio of page height). */
137+
/**
138+
* Full-width band flush with the bottom of the page (height = ratio of page height).
139+
*
140+
* @param heightRatio height as a fraction of the canvas height (0..1]
141+
* @param color fill color (required)
142+
* @return a {@code PageBackgroundFill} spanning the full page width at the bottom edge
143+
*/
107144
public static PageBackgroundFill bottomBand(double heightRatio,
108145
DocumentColor color) {
109146
return new PageBackgroundFill(0.0, 1.0 - heightRatio, 1.0,
110147
heightRatio, color);
111148
}
112149

113-
/** Full-width band whose top edge sits {@code yRatioFromTop} down the page (0.0 = page top). */
150+
/**
151+
* Full-width band whose top edge sits {@code yRatioFromTop} down the page (0.0 = page top).
152+
*
153+
* @param yRatioFromTop top edge of the band: 0.0 = page top, 1.0 = page bottom
154+
* @param heightRatio height as a fraction of the canvas height (0..1]
155+
* @param color fill color (required)
156+
* @return a {@code PageBackgroundFill} spanning the full page width from {@code yRatioFromTop}
157+
*/
114158
public static PageBackgroundFill band(double yRatioFromTop,
115159
double heightRatio,
116160
DocumentColor color) {
117161
return new PageBackgroundFill(0.0, yRatioFromTop, 1.0,
118162
heightRatio, color);
119163
}
120164

121-
/** Top-aligned band sized in absolute points, converted against {@code pageHeight}. */
165+
/**
166+
* Top-aligned band sized in absolute points, converted against {@code pageHeight}.
167+
*
168+
* @param heightPoints band height in points
169+
* @param pageHeight reference page height in points used to convert points to a ratio
170+
* @param color fill color (required)
171+
* @return a {@code PageBackgroundFill} spanning the full page width at the top edge
172+
*/
122173
public static PageBackgroundFill topBandPoints(double heightPoints,
123174
double pageHeight,
124175
DocumentColor color) {
125176
return topBand(heightPoints / pageHeight, color);
126177
}
127178

128-
/** Band positioned and sized in absolute points from the page top, converted against {@code pageHeight}. */
179+
/**
180+
* Band positioned and sized in absolute points from the page top, converted against {@code pageHeight}.
181+
*
182+
* @param yFromTopPoints offset of the band top edge from the page top in points
183+
* @param heightPoints band height in points
184+
* @param pageHeight reference page height in points used to convert points to ratios
185+
* @param color fill color (required)
186+
* @return a {@code PageBackgroundFill} spanning the full page width from {@code yFromTopPoints}
187+
*/
129188
public static PageBackgroundFill bandPoints(double yFromTopPoints,
130189
double heightPoints,
131190
double pageHeight,

src/main/java/com/demcha/compose/document/backend/fixed/pdf/handlers/PdfTableRowFragmentRenderHandler.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ public void render(PlacedFragment fragment,
5353
* fragments of a table before rendering borders. Painting fills under the
5454
* eventual stroke avoids sub-pixel page-background seams around row-span
5555
* joins.</p>
56+
*
57+
* @param fragment placed row fragment to render
58+
* @param payload table-row payload carrying the resolved cells
59+
* @param environment active PDF render environment
60+
* @throws java.io.IOException if writing to the PDF content stream fails
5661
*/
5762
public void renderFills(PlacedFragment fragment,
5863
TableRowFragmentPayload payload,
@@ -68,6 +73,11 @@ public void renderFills(PlacedFragment fragment,
6873

6974
/**
7075
* Paints table cell borders and text for one row fragment.
76+
*
77+
* @param fragment placed row fragment to render
78+
* @param payload table-row payload carrying the resolved cells
79+
* @param environment active PDF render environment
80+
* @throws java.io.IOException if writing to the PDF content stream fails
7181
*/
7282
public void renderBordersAndText(PlacedFragment fragment,
7383
TableRowFragmentPayload payload,

src/main/java/com/demcha/compose/document/backend/semantic/SemanticExportContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public record SemanticExportContext(
3636

3737
/**
3838
* Backwards-compatible constructor without explicit output options.
39+
*
40+
* @param canvas physical page canvas for semantic export
41+
* @param customFontFamilies document-local font families available to the backend
42+
* @param outputFile optional export output file
3943
*/
4044
public SemanticExportContext(LayoutCanvas canvas,
4145
Collection<FontFamilyDefinition> customFontFamilies,

src/main/java/com/demcha/compose/document/dsl/ShapeContainerBuilder.java

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,47 +318,92 @@ public ShapeContainerBuilder back(DocumentNode node) {
318318
// read the same way. Keeping the surface aligned helps autocomplete:
319319
// "I started with addCircle, the same vocabulary works."
320320

321-
/** Anchors a layer to the top-left corner. */
321+
/**
322+
* Anchors a layer to the top-left corner.
323+
*
324+
* @param node child node
325+
* @return this builder
326+
*/
322327
public ShapeContainerBuilder topLeft(DocumentNode node) {
323328
return layer(node, LayerAlign.TOP_LEFT);
324329
}
325330

326-
/** Anchors a layer to the top edge, centred horizontally. */
331+
/**
332+
* Anchors a layer to the top edge, centred horizontally.
333+
*
334+
* @param node child node
335+
* @return this builder
336+
*/
327337
public ShapeContainerBuilder topCenter(DocumentNode node) {
328338
return layer(node, LayerAlign.TOP_CENTER);
329339
}
330340

331-
/** Anchors a layer to the top-right corner. */
341+
/**
342+
* Anchors a layer to the top-right corner.
343+
*
344+
* @param node child node
345+
* @return this builder
346+
*/
332347
public ShapeContainerBuilder topRight(DocumentNode node) {
333348
return layer(node, LayerAlign.TOP_RIGHT);
334349
}
335350

336-
/** Anchors a layer to the left edge, centred vertically. */
351+
/**
352+
* Anchors a layer to the left edge, centred vertically.
353+
*
354+
* @param node child node
355+
* @return this builder
356+
*/
337357
public ShapeContainerBuilder centerLeft(DocumentNode node) {
338358
return layer(node, LayerAlign.CENTER_LEFT);
339359
}
340360

341-
/** Centred layer (the typical foreground content above an outline fill). */
361+
/**
362+
* Centred layer (the typical foreground content above an outline fill).
363+
*
364+
* @param node child node
365+
* @return this builder
366+
*/
342367
public ShapeContainerBuilder center(DocumentNode node) {
343368
return layer(node, LayerAlign.CENTER);
344369
}
345370

346-
/** Anchors a layer to the right edge, centred vertically. */
371+
/**
372+
* Anchors a layer to the right edge, centred vertically.
373+
*
374+
* @param node child node
375+
* @return this builder
376+
*/
347377
public ShapeContainerBuilder centerRight(DocumentNode node) {
348378
return layer(node, LayerAlign.CENTER_RIGHT);
349379
}
350380

351-
/** Anchors a layer to the bottom-left corner. */
381+
/**
382+
* Anchors a layer to the bottom-left corner.
383+
*
384+
* @param node child node
385+
* @return this builder
386+
*/
352387
public ShapeContainerBuilder bottomLeft(DocumentNode node) {
353388
return layer(node, LayerAlign.BOTTOM_LEFT);
354389
}
355390

356-
/** Anchors a layer to the bottom edge, centred horizontally. */
391+
/**
392+
* Anchors a layer to the bottom edge, centred horizontally.
393+
*
394+
* @param node child node
395+
* @return this builder
396+
*/
357397
public ShapeContainerBuilder bottomCenter(DocumentNode node) {
358398
return layer(node, LayerAlign.BOTTOM_CENTER);
359399
}
360400

361-
/** Anchors a layer to the bottom-right corner. */
401+
/**
402+
* Anchors a layer to the bottom-right corner.
403+
*
404+
* @param node child node
405+
* @return this builder
406+
*/
362407
public ShapeContainerBuilder bottomRight(DocumentNode node) {
363408
return layer(node, LayerAlign.BOTTOM_RIGHT);
364409
}

src/main/java/com/demcha/compose/document/dsl/Transformable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public interface Transformable<T extends Transformable<T>> {
3636
T transform(DocumentTransform transform);
3737

3838
/**
39+
* Returns the transform currently configured on the builder.
40+
*
3941
* @return the transform currently configured on the builder; never
4042
* {@code null} (defaults to {@link DocumentTransform#NONE})
4143
*/

src/main/java/com/demcha/compose/document/layout/FixedSlotPlacementContext.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
* place into a fixed page band — the parent flow has already decided which
99
* page is being filled, so children must not move on by themselves.
1010
*
11+
* @param pageIndex pinned page index that placements land on
12+
* @param canvas canvas the placement is happening on
13+
* @param prepareContext prepare-phase context used to (re)measure children
14+
* @param fragmentContext fragment-emission context forwarded to {@code emitFragments}
15+
* @param nodes mutable list of placed semantic nodes; helpers append to this
16+
* @param fragments mutable list of placed render fragments; helpers append to this
1117
* @author Artem Demchyshyn
1218
*/
1319
public record FixedSlotPlacementContext(

src/main/java/com/demcha/compose/document/layout/NodeDefinitionSupport.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ public static PreparedSplitResult<TableNode> splitTable(PreparedNode<TableNode>
459459
* Emits row fragments for a prepared table.
460460
*
461461
* @param prepared prepared table node
462+
* @param ctx fragment-emission context
462463
* @param placement resolved fragment placement
463464
* @return renderer-facing table row fragments
464465
*/

0 commit comments

Comments
 (0)