eclipse文档注释设置、文件(Files)注释标签、类型(Types)注释标签(类的注释)、字段(Fields)注释标签、构造函数(Constructor)标签

本文详细介绍了如何在Java项目中设置文件、类型、字段、构造函数、方法、覆盖方法、代理方法、getter和setter的注释模板,助您提升代码规范性和可读性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


设置注释模板的入口:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素。本文将每一个元素逐一给大家介绍一下。

在这里插入图片描述
在这里插入图片描述

1.文件(Files)注释标签

/**  
 * @Title: ${file_name}
 * @Description: 
 * @author Redamancy
 * @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')} 
 */ 

2.类型(Types)注释标签(类的注释)

/**  
 * @ClassName: ${type_name}
 * @Description: 
 * @author Redamancy
 * @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')} 
*/  


3.字段(Fields)注释标签

/**  
 * @Fields ${field}
 * @Description: 
 * @author Redamancy
 * @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')} 
 */  
 

4.构造函数(Constructor)标签

/**  
 * @Constructor: ${enclosing_type}
 * @Description: ${enclosing_type}构造函数
 * @author Redamancy
 * @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')} 
 */ 

5.方法(Methods)标签

/**  
 * @MethodName: ${enclosing_method}
 * @Description: ${todo}
 * @author Redamancy
 * @return ${return_type}
 * @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')} 
 */  

6.覆盖方法(Overriding Methods)标签

/**  
 * @MethodName: ${enclosing_method}
 * @Description: ${todo}
 * @author Redamancy
 * ${tags}
 * ${see_to_overridden}
 * @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')} 
 */  


7.代理方法(Delegate Methods)标签

/**  
* ${tags}
* ${see_to_target}  
*/

8.getter方法标签

/**
 * @return the ${bare_field_name}
 */

9.setter方法标签

/**
 * @param ${param} the ${bare_field_name} to set
 */
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Redamancy_06

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值