Java file header annotation format settings in eclipse
Java file header annotation format settings in eclipse
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 <a href= "[email protected]" >Jerryli</a>
* @version 1.0
*
*/
Note that choosing to add comments automatically is the best way 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->code style->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 rights reserved, designed by zte-its
* Copyright: copyright (C) 2010-2011
&NBSP;*&NBSP; @author : name
* @version V1.0
* CreateDate: ${date} ${time}
*
* Modification History:
* Date Author Version discription
* -----------------------------------------------------------------------------------
* ${date} WU.ZH 1.0 1.0
* Why & 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>
*/
Java file header annotation format settings in eclipse