如何在eclipse 中设置自动添加Javadoc注释

如题所述

windows-->preference-->Java-->Code Style-->Code Templates-->code-->new Java file
例如在new java file中编辑模版如下:
${filecomment}${package_declaration}
/**
* @author : suyuyuan
* @date 创建时间:${date} ${time}
* @version 1.0
* @parameter
* @since
* @return
*/
${typecomment}${type_declaration}

新建class类时就会出现如下效果:
package com.suyuyuan.demo.common;
/**
* @author : suyuyuan
* @date 创建时间:2016年3月15日 下午5:40:45
* @version 1.0
* @parameter
* @since
* @return
*/
public class Test {

}
再如:
${filecomment}
${package_declaration}
/**
*
* @ClassName: ${type_name}
* @Description: ${todo}
* @author suyuyuan
* @date ${date} ${time}
*
*/
${typecomment}
${type_declaration}
样式如下:
package Util;
/**
*
* @ClassName: Test
* @Description: TODO
* @author suyuyuan
* @date 2016年10月10日 上午10:08:45
*
*/
public class Test{

}
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答