MyEclipse the Java file header annotation format setting

Source: Internet
Author: User

Windows->preferences->java->code Templates->comments->type->edit

Eclipse Annotations Specification Template Summary

New class file
/**
* @ClassName: ${file_name}
* @Description: ${todo} (describe what the file does in a word)
*
* @author ${user}
* @version V1.0
* @Date ${date}${time}
*/

Method
/** 
 * @Title:        ${enclosing_method} 
 * @Description:  ${todo} (here is a word describing the effect of this method)  
 * @param:        ${tags}    
 * @return:       ${return_type}     
 * @throws  
 * @author         ${ User}
 * @Date           ${date}${time} 
 */


Enter the setup Template:

/**
* ${file_name} Create on ${date}
*
* Copyright (c) ${date} by Taotaosoft
*
* @author <ahref= "[email protected]" >Jerryli</a>
* @version 1.0
*
*/

Note Choosing to add comments automatically

It is best to develop a standard habit.


Select Menu
Windows-->preference
Java-->code Style-->code Templates
Code-->new Java Files

Select Point Edit

${filecomment}
${package_declaration}
/**
* @author author name E-mail:email address
* @version creation time: ${date} ${time}
* Class Description
*/
${typecomment}
${type_declaration}

Eclipse Annotations Specification Template Summary

1, the specific operation

(1) in Eclipse, open the Window->preference->java->codestyle->code Template

(2) then expand the Comments node is all the elements that need to set comments, refer to the 2 annotation specification corresponding settings can be

2. Annotation specification

(1) Note Label for file (files)

/**

*filename: ${file_name}

* @Description: ${todo} (describe what the file does in a word)

* All rightsreserved, designed by Zte-its

*copyright:copyright (C) 2010-2011

*company zte-its WuXi LTD.

* @author: Name

* @version V1.0

*createdate: ${date}${time}

*

*modification History:

*date Author Version discription

*

* ${date} WU.ZH 1.0 1.0

* why& What is modified: < Modify reason Description >

*/

(2) type (Types) Comment Label (note for Class):

/**

* @ClassName: ${type_name}

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

* @author: Android_robot

* @date: ${date} ${time}

*

*${tags}

*/

(3) Field Comment Label:

/**

* @Fields ${field}: ${todo} (describe what this variable means in a sentence)

*/

(4) Constructor Tags:

/**

* @Title: ${enclosing_type}

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

* @param: ${tags}

* @throws

*/

(5) method (Methods) Label:

/**

* @Title: ${enclosing_method}

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

* @param: ${tags}

* @return: ${return_type}

* @throws

*/

(6) Overlay method (overriding Methods) Label:

/**

*<p>title: ${enclosing_method}</p>

*<p>description: </p>

*${tags}

*${see_to_overridden}

*/

(7) Representative method (Delegate Methods) Label:

/**

*${tags}

*${see_to_target}

*/

(8) Getter Method Label:

/**

* @Title: ${enclosing_method}<br>

* @Description: Please write your Description <BR>

* @return: ${field_type}<br>

*/

(9) Setter method Label:

/**

* @Title: ${enclosing_method} <BR>

* @Description: Please write your Description <BR>

* @return: ${field_type} <BR>

*/

ren

MyEclipse the Java file header annotation format setting

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.