RFR: 8356975: Provide alternative way to generate preview API docs

Hannes Wallnöfer hannesw at openjdk.org
Fri Jul 11 13:56:52 UTC 2025


Please review a change to allow marking API elements as preview features via a new hidden `--preview-feature-tag` option. In conjunction with the already existing hidden `--preview-note-tag` option this allows documenting elements as preview features without relying on JDK-internal types. 

Part of this change is a refactoring of how `SummaryListWriter` allows its subclasses to extend the content of summary pages. The old `addExtra*` hook methods were too unflexible as they always add extra content before other page content. I replaced them with protected `getIndexLinks` and `addSummaries` methods that allow overriding methods to add extra content before or after the default content returned by the super method.

The change also includes the fix for [JDK-8355933](https://bugs.openjdk.org/browse/JDK-8355933) to change the presentation and wording for elements with preview notes as requested by the Valhalla team. 

The output generated by the new test with preview features marked by tags [can be viewed here](https://cr.openjdk.org/~hannesw/8356975/out.00/api/package-summary.html).

-------------

Commit messages:
 - Merge branch 'master' into JDK-8356975
 - Improve implementation and add test
 - JDK-8356975: Provide alternative way to generate preview API docs
 - 8355933: Change section title for permanent APIs affected by preview features

Changes: https://git.openjdk.org/jdk/pull/26267/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26267&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356975
  Stats: 509 lines in 14 files changed: 427 ins; 30 del; 52 mod
  Patch: https://git.openjdk.org/jdk/pull/26267.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26267/head:pull/26267

PR: https://git.openjdk.org/jdk/pull/26267


More information about the javadoc-dev mailing list