The first method:
You can use the Javadoc tool. It can be extracted from the program source code such as classes, methods, member variables and other documents to form an API supporting documentation. However, when writing code, it is necessary to comment on certain specifications. The development documentation for the code can be generated at the same time through the Javadoc implementation tool. The Javadoc tool is located under the C:\Program files\java\jdk1.6.0_10\bin path.
Where/**...*/this annotation is used to support the Javadoc tool, there are also some identification information at the beginning of the @ can be extracted, such as.
Here is an example of using the Stringbuffer.java file in the source code.
Open the Console window and first enter the Stringbuffer.java directory, which is placed in the C drive test directory.
Execute Javadoc Stringbuffer.java
Such as
If the report cannot find the command, verify that the environment variable is configured when the JDK is installed.
The resulting file is as follows.
Open the file and you will see a description document similar to the Java API style.
The second way:
Implemented with Eclipse.
Right-click in the list of items, select Export,
Then in the Export dialog box, select Javadoc under Java, next.
In the Javadoc Generation dialog box:
Javadoc command: You should select Javadoc.exe in the JDK bin directory
Destination: The save path for the generated document.
Finish commits to start generating the document.
Welcome to visit my blog
How Java extracts comments from a program to generate a description document