In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to generate JavaDoc comments into API documents, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.
Generate JavaDoc comments into API documents
1. Open the java code and write JavaDoc comments. Only by writing comments in accordance with java specifications can you generate API documents very well. The difference between javadoc comments and ordinary comments is one more * (asterisk). Ordinary code is commented as / * XXX*/, while javadoc is commented as / * * XXX*/
2. Javadoc comments should be written in detail as much as possible, so that others will only know if there is no source code, such as
How to use your code.
3. Click the [Project] menu of eclipse and select the [Generate JavaDoc] option.
4.
(1) Select the project for which you want to generate JavaDoc
(2) choose which level of content to generate JavaDoc. The default is public. If you select private, all content will be generated.
(3) Select the location where doc is generated. By default, it is under the project directory. It is recommended that you do not modify it.
(4) Click the [Next] button
5.
(1) check Document Title and fill in the document title.
(2) Click the [Next] button
6.
(1) choose the version of jdk to use (choose as much as your version is)
(2) Click the [Finish] button
7. You can see the console output the information that generates the javadoc.
8. Generate a [doc] directory under the project, in which javadoc documents are stored.
9. Open the doc directory and open index.html with a browser
10. You can see a complete API document, and the javadoc is generated.
Java automatic api document generation Yapi
In the process of development, the interface document is the front and back end, the basis for testing interaction, and the timeliness and accuracy of document updates are very important.
Shortcomings of word documents
Write it manually and make a lot of mistakes.
The poor readability of the document tests the patience of the writer
Unable to debug online
Poor timeliness
Shortcomings of swwager documents
Poor readability of documents
Unable to debug online for requests with authorized token
Unable to import and export api documents
Testing and development cannot communicate on documentation
Yapi solves all the above problems. Yapi can support java apidoc and be compatible with swwager. As long as idea installs the corresponding plug-in, you can right-click upload to yapi and automatically generate api interface documents.
@ ApiOperation ("administrator creates users") @ ApiImplicitParams ({@ ApiImplicitParam (paramType = "header", name = "Authentication", dataType = "String", required = true, value = "user token")}) @ PostMapping ("/ users/user") public CommonResult createUser (@ Validated @ RequestBody UserAddRequest userAddRequest) {Assert.isTrue (userAddRequest! = null, "invalid userAddRequest"); return CommonResult.ok (userService.addUser (userAddRequest));}
The above is how to generate JavaDoc comments into API documents. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.