RFR : 8008632 : Additional JavaDoc tags @apiNote, @implSpec and @implNote for JDK API Docs

Alan Bateman Alan.Bateman at oracle.com
Thu Apr 18 12:07:31 UTC 2013


On 18/04/2013 00:51, Mike Duigou wrote:
> Hello All;
>
> Some of you have noticed that the lambda streams libraries patches currently going in to the TL repo make use of special javadoc tags. There are three tags being used:
>
> @apiNote : Non-normative notes about the API. Usually used for examples.
> @implSpec : Describes required behaviour of conforming implementations. Key is that the description is not inherited.
> @implNote : Non-normative notes about the implementation. Typically used for descriptions of the behaviour. Also not inherited.
>
> The tags are used primarily by default method implementations but will be used elsewhere as well.
>
> These tags are enabled by use of the -tag feature on the javadoc tool command line. They are not proposed as standard javadoc tags and may be implemented differently in future Java releases. Since they are implemented as custom tags just for the JDK API documentation you can't automatically use them in your own code. (You can, of course, add the same command line options to your javadoc invocations if you like these tags).
>
> http://cr.openjdk.java.net/~mduigou/JDK-8008632/0/webrev/
>
> The patch enumerates the new custom tags in addition to the standard tags to ensure correct output order.
>
@implSpec is very welcome, more reasons now with the addition of default 
methods.

Clearly distinguishing normative from non-normative text is also been a 
long standing problem so having a tag to identify the non-normative text 
is very useful. I had to look at a few examples in the lambda/jdk repo 
to convince myself that both @apiNote and @implNote are needed. One 
thing that isn't clear to me is whether the "official" Java SE 
documentation should include the text tagged @implNote or not.

Are you planning to provide a documentation page for these tags? This 
would be useful to others writing API docs in the future.

One question on the webrev. You've listed "factory" and I'm not sure 
that I recognize this. A long standing needs has been to distinguish 
static factory methods in the javadoc and perhaps this is related to 
that? I might have missed something of course.

-Alan



More information about the core-libs-dev mailing list