Skip to content

refactor(api): remove the deprecated forRemoval APIs#318

Merged
DemchaAV merged 1 commit into
2.0-devfrom
build/2.0-r5-remove-deprecated
Jul 6, 2026
Merged

refactor(api): remove the deprecated forRemoval APIs#318
DemchaAV merged 1 commit into
2.0-devfrom
build/2.0-r5-remove-deprecated

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Why

2.0 is binary-breaking by design, so the @Deprecated(forRemoval) surface carried through the 1.6–1.9 line can finally go. Every removed element already has a canonical replacement, so callers migrate with a rename.

What

  • DocumentSession.builder()dsl(), DocumentDsl.text()paragraph().
  • The PDF-typed chrome overloads DocumentSession.{metadata,watermark,protect,header,footer}(Pdf*Options) → the canonical Document{Metadata,Watermark,Protection,HeaderFooter} overloads. Removing them let the now-dead package-private DocumentChromeOptions Pdf* converters and PdfOutputOptionsToCanonical go too, fully decoupling document.api from backend.fixed.pdf.options. The Pdf*Options types stay usable on PdfFixedLayoutBackend.builder().
  • linkOptions() on the paragraph / table / image / shape / ellipse / line / barcode nodes and the inline image / shape / text runs → linkTarget() (external URI via ExternalLinkTarget.options()).
  • Engine-internal Font.adjustFontSizeToFit (+ PdfFont / WordFont implementations), unused — auto-size is resolved by the layout compiler.

Callers and tests move to the replacements. The session-convenience chrome test is retargeted onto the canonical option types (and renamed) so its end-to-end render assertions — doc-info fields, encryption + permissions, header/footer/watermark text, clearHeadersAndFooters — are preserved. CHANGELOG.md and the 2.0 module-migration guide record the removals.

RowBuilder.gap (deprecated since 1.5.0, not forRemoval) and the independent ShapeBuilder.linkOptions field are left untouched.

Tests

Full aggregator verify — core + render-pdf + render-docx + render-pptx + templates + testing + qa, including the javadoc and documentation-snippet-compile gates: BUILD SUCCESS, 0 failures.

2.0 is binary-breaking by design, so the @deprecated(forRemoval) surface
carried through the 1.6-1.9 line can go. Each removed element has a
canonical replacement, so callers migrate with a rename.

- DocumentSession.builder() -> dsl(); DocumentDsl.text() -> paragraph().
- The PDF-typed chrome overloads
  DocumentSession.{metadata,watermark,protect,header,footer}(Pdf*Options)
  -> the canonical Document{Metadata,Watermark,Protection,HeaderFooter}
  overloads. This drops the last backend.fixed.pdf.options coupling from
  document.api: the package-private DocumentChromeOptions Pdf* converters
  and PdfOutputOptionsToCanonical were dead once the bridges went. The
  Pdf*Options types remain available on PdfFixedLayoutBackend.builder().
- linkOptions() on the paragraph/table/image/shape/ellipse/line/barcode
  nodes and the inline image/shape/text runs -> linkTarget() (external
  URI via ExternalLinkTarget.options()).
- Font.adjustFontSizeToFit (+ PdfFont/WordFont impls): engine-internal
  and unused; auto-size is resolved by the layout compiler.

Callers and tests move to the replacements. The session-convenience
chrome test is retargeted onto the canonical option types (and renamed),
preserving its end-to-end render assertions.
@DemchaAV DemchaAV merged commit 956532a into 2.0-dev Jul 6, 2026
10 checks passed
@DemchaAV DemchaAV deleted the build/2.0-r5-remove-deprecated branch July 6, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant