Intellij How does idea generate Javadoc?

Source: Internet
Author: User

Javadoc Basic Introduction

Javadoc is a technology provided by sun, which extracts classes, methods, members, and other annotations from the program source code to form an API help document supporting the source code. In other words, as long as the program is written with a set of specific tags as a comment, after the completion of the program, through the Javadoc can be formed at the same time the development of the program document.

The Javadoc command is used to generate your own API documentation using the command line to enter the Javadoc + file name in the directory where the destination file is located. java.

Javadoc Common identification
Label Description JDK 1.1 Doclet Standard Doclet Label type
@author author Author identification Packages, classes, interfaces
@version version number Version number Packages, classes, interfaces
@param parameter Name Description The parameter name and description information of the method, such as the special requirements for the entry, can be commented on here. constructors, methods
@return Description Comment on the return value of the function Method
@deprecated Expired Text Logo as the program version of the upgrade, the current API has expired, only to ensure that the compatibility still exists, so that developers should not use this API. Package, class, interface, domain, constructor, method
@throws Exception class name The exception that is thrown by the constructor or method.
constructors, methods
@exception Exception class name With @throws. constructors, methods
@see References View related content, such as classes, methods, variables, and so on. Package, class, interface, domain, constructor, method
@since Description Text The API is developed after what version of the program is supported. Package, class, interface, domain, constructor, method
{@link package. Class # member Label} Link to a document that corresponds to a specific member.
Package, class, interface, domain, constructor, method
{@value} When commenting on a constant, if you want to include its value in the document, the value of the constant is referenced by the label.
√ (JDK1.4) Static domain

There are also several infrequently used tags for @serial, @serialField, @serialData, {@docRoot}, {@inheritDoc}, {@literal}, {@code} {@value arg}, as infrequently used. We unfold the narrative and interested readers can view the help documentation.

So how do we generate Javadoc through IntelliJ idea?

The first step: Locate the tool in the toolbar, and then find Generate JavaDoc in the submenu.

Step Two: Configure on the build document.

A brief description of the configuration:

Parameter description

1.Whole Project: The entire project is generated in document 2. Custom scope Customization. as follows: (1) Project files projects file, (2) Project production files item product file, (3) test file for project test files, unknown range, class hierarchy layer 3.INCLU The de test source contains the test directory 4.include JDK and ... Includes JDK and other third-party jar5.link to JDK documentation ... Link to JDK api6.output directy generated document location (1) Private, package, protected, public generate document levels (classes and methods) (2) to the right of the generate ... Is the selection of the generated document that contains the content, hierarchy tree, navigation, index ... (3) to the right is the generated document contains the content information, the author version and other information 7. Locale language type, zh-cn8.other command line arguments other parameter 9. Maximum Heep ... Maximum stack

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

1.Whole Project: document is generated for the entire project

2.Custom scope custom scope. As follows:

(1) project files,

(2) project production files Item product file,

(3) test file for project test files, unknown range,class Hierarchy class Layer

3.include test source contains testing directory

4.include JDK and ... contains jdk and other third-party jars

5.link to JDK documentation ... Linking to the JDK API

6.output directy where the generated documents are stored

(1)private,package,protected, Public level of document generation (classes and methods)

(2) The Generateon the right ... is to select the content that the generated document contains, hierarchy tree, navigation, index . .

(3) to the right is the generated document contains the content information, the author version and other information

7.Locale language type ,zh-CN

8.Other command line arguments Other parameters

9.Maximum heep... Maximum Stack

My configuration here is as follows:

Description: IntelliJ idea as a popular Java editor, the generation of some Javadoc will be garbled in Chinese, using UTF-8 encoding can be. For this common problem, you need to set the parameters when you build.

In the "Tools->gerenate JavaDoc" version of the "Other command line arguments:" Column, enter:

-encoding Utf-8-charset Utf-8

1

- encoding UTF - 8 -charset UTF-8

Otherwise, an error may be reported: the encoding of the GBK non-mapped characters.


Intellij How does idea generate Javadoc?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.