https://www.jetbrains.com/help/idea/working-with-code-documentation.html
틀린 내용이 있다면 알려주세요 💻
Javadoc는 Java 소스 코드에서 HTML 형식의 Java 코드 문서를 생성하는 도구이다
일반적으로 클래스, 메소드 또는 필드 위에 배치되는 Javadoc 주석으로 구성된다
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
Add a new comment
1. Add a Javadoc using automatic comments
/** 주석 만들기
2.Add a Javadoc using context actions
For method comments, the new comment stub contains the required tags (@param tags for each method parameter, @return, or @throws).
Disable automatic comments
- In the Settings dialog ⌘ ,, go to Editor | General | Smart Keys, and clear the Insert documentation comment stub checkbox.
Render Javadocs
주석 편집은 저 목록아이콘을 누르거나 (or press ⌃ ⌥ Q) to toggle the rendered view; click to edit the comment.
Generate a Javadoc reference
IntelliJ IDEA provides a utility that enables you to generate a Javadoc reference for your project.
- 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.
- The Output directory is a mandatory field: you cannot generate a Javadoc file as long it is empty.
- Use the slider to define the visibility level of members that will be included in the generated documentation. Select one of the following options:
- Private: to include all classes and members to the reference.
- Package: to include all classes and members except the private ones.
- Protected: to include public and protected classes and members.
- Public: to include only public classes and members.
- You can specify a locale (for example en_US.UTF-8), command line arguments, and the maximum heap size.
- Click OK to generate the reference.
View Javadocs in the editor
In IntelliJ IDEA, you can view Javadocs for any symbol or method signature right from the editor. To be able to do that, configure library documentation paths or add downloaded Javadocs to the IDE. For more information, refer to Configure library documentation.
- Hover the mouse over the necessary symbol in the editor.
- Place the caret at the symbol and press F1 (View | Quick Documentation).
- Press F1 again to open this documentation in the Documentation tool window.
For more information, refer to Quick Documentation
Troubleshoot
javadoc: error - Malformed locale name: en_US.UTF-8
Clear the Locale field. In the Other command line arguments field, add -encoding utf8 -docencoding utf8 -charset utf8.
-encoding specifies the encoding of the source files. -docencoding specifies the encoding of the output HTML files and -charset is the charset specified in the HTML head section of the output files.
'Web > JAVA' 카테고리의 다른 글
[Java] Interface Supplier<T> (0) | 2023.03.22 |
---|---|
[Java] this (0) | 2023.03.22 |
[Java] try-with-resources (0) | 2023.02.25 |
[JAVA 8↑] Stream (0) | 2023.02.21 |
[JAVA 8↑] lambda expression (0) | 2023.02.20 |