Authoring of Android Studio document Javadoc and custom annotation templates

Source: Internet
Author: User


(a) Usually Javadoc template annotation generation method:

Enter/**<ENTER> on the line above the function name, and automatically generate the following annotation format:

/**

* Here's a quick introduction to function functions

* @param

* @param

* @return

*/

(ii) Generate Javadoc:

Click on the Android Studio menu bar tools->generate javadoc-> Select whole project or custom scope-> Select output Directory as the Javadoc build location->ok.

Note: If you are prompted for an encoding error, enter the following command line arguments:-encoding utf-8-charset Utf-8

According to the above method, the basic Javadoc can be generated.


If you want to customize the annotation template, refer to the following:

Http://www.jb51.net/article/69923.htm

That

1.file-> setting->editor->live Templates

2. Click + to create a template group, enter the group name

3. Select the group you just created to create the live Template

4. Fill in the abbreviation, I filled in here is CMT, that is, you this note shortcut, you knock CMT Plus Enter, the template is out

Templates text is a template for comments, specific to how you want to write the template can be, my template is as follows:

/**
*〈 A brief statement of the function of a sentence
*〈 Function Detail Description
* @param[parameter 1] [parameter 1 description]
* @param[Parameter 2] [parameter 2 description]
* @return[Return type description]
* @exception/throws[Type of violation] [description of violation]
* @see[Class, Class # method, Class # member]
*/

5. to set up your CMT shortcut key where it takes effect, my choice is in the declaration (java-declaration) in effect, that is, you in the method name of the CMT plus carriage return on it.

6. Click Apply to finish.




This article is from the "whatever957" blog, make sure to keep this source http://whatever957.blog.51cto.com/6835003/1791913

Authoring of Android Studio document Javadoc and custom annotation templates

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.