RFR: 8266666: Implementation for snippets
Jonathan Gibbons
jjg at openjdk.java.net
Fri Jul 23 18:51:07 UTC 2021
On Thu, 15 Jul 2021 14:13:16 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
> This PR implements JEP 413 "Code Snippets in Java API Documentation", which hasn't been yet proposed to target JDK 18. The PR starts as a squashed merge of the https://github.com/openjdk/jdk-sandbox/tree/jdk.javadoc/snippets branch.
More feedback;
1. It seems reasonable to introduce the `...taglets.snippets` package. It seems excessive to have three sub packages within that, for `actions`, `parser` and `text`, especially when the last contains just a single class.
2. At some point soonish, we will need API somewhere to get the content of the snippet. This is necessary to fulfill the goal in the JEP to support validation of snippet content. Without any such API, validation code would have to duplicate at least some of the code to handle snippets. This API should probably not be in `com.sun.source` and should probably be in the `jdk.javadoc` module, perhaps on the existing `StandardDoclet` class. One way to do that would be to introduce a utility interface to provide access to support for taglets, and then have a method on `StandardDoclet` to access an instance of that utility for a specific snippet, identified by element and/or id.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4795
More information about the compiler-dev
mailing list