Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get the javadoc tool to document annotations?

Tags:

In my project, we use a number of annotations that would be very useful to see in the javadoc API documentation.

Does anyone know a simple way to include annotations in generated javadocs? I don't want to write my own javadoc plugin. Are there any solutions out there?

like image 942
Elijah Avatar asked Jul 22 '09 20:07

Elijah


People also ask

How do I enable javadoc?

From the main menu, select Tools | Generate JavaDoc. In the dialog that opens, select a scope — a set of files or directories for which you want to generate the reference, and set the output directory where the generated documentation will be placed.

How can you generate javadoc documentation for your code?

Step 1 − Open eclipse, select the option Project →Generate Javadoc. Step 2 − Select the javadoc.exe file from the bin folder of java installation directory, select the destination folder for the generated java doc and select Next. finish button.

How do I fix missing javadoc?

Go to Project > Properties > Java Build Path > Libraries and Choose . jar file which has missing Javadoc>(You should see Javadoc location: (None)) Click Edit and Provide Javadoc location file and press OK. Please do comment if you have any better way handy.

Is javadoc still used?

Javadoc is pretty much the accepted standard for documenting java code.


1 Answers

See java.lang.annotation.Documented

Indicates that annotations with a type are to be documented by javadoc and similar tools by default. This type should be used to annotate the declarations of types whose annotations affect the use of annotated elements by their clients. If a type declaration is annotated with Documented, its annotations become part of the public API of the annotated elements.

Example:

import java.lang.annotation.Documented;  @Documented public @interface MyAnnotation { } 
like image 180
Robert Munteanu Avatar answered Sep 28 '22 04:09

Robert Munteanu