Eclipse automatically adds a comment template

Source: Internet
Author: User
Tags custom name

Eclipse uses automatic commenting: Set the following template under the Eclipse tool's Window\preferences\java\code Style\code templates\comments

Files Comment Label

/**@author@version* /

Special Note:   for the "${user}" configuration, if you want to configure your own custom name, such as: Zhang San, you will need to find it in the Eclipse/myeclipse directory eclipse.ini/ Myeclipse.ini file, add a startup parameter behind-vmargs:-duser.name= Zhang San, and restart MyEclipse tool "* @author ${user}" will change to "* @author Zhang San".

Type (Types) Comment Label (Note for Class)

/**      * @ClassName: ${type_name}  * @Description: ${todo} (here is a sentence describing the role of this  Class)@author  */

field (fields) Comment label

/** * @Description: ${todo} (here is a word describing the role of this  class) */

Constructor tags

/***/

Method (Constructor & Methods) label

/**      * @Title: ${enclosing_method}  * @Description: ${todo} (here is a word describing the effect of this  method)@return   @throws* /

Override method (overriding Methods) label

/**      @throws* /

Proxy method (Delegate Methods) label

/**      * @Title: ${enclosing_method}  * @Description: ${todo} (here is a word describing the function of this  method)@throws* /

Getter Method Label

/**      * @Title: Returns   the value of ${bare_field_name} @return* /

Setter Method Label

/**     @param* /

After the settings are complete, you can enter/** and then enter to add comments automatically.

Eclipse automatically adds a comment template

Related Article

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.