设置位置:windows=>Preferences=> Java=> code Style =>code Template
/** * @return the ${bare_field_name} */ /** * @param ${param} the ${bare_field_name} to set */ /** * @Title:构造器 * @Description:Comment for created constructors * @author 张颖辉 * @date ${date}${time} * ${tags} */ /** * @Title:${file_name} * @Description:Comment for created Java file * @author 张颖辉 * @date ${date}${time} * @version 1.0 */ /** * @Title:${type_name} * @Description:Comment for created type * @author 张颖辉 * @date ${date}${time} * @version 1.0 * ${tags} */ /** * @Title:字段属性 ${field} * @Description:Comment for fields * @author 张颖辉 * @date ${date}${time} */ /** * @Title:函数 * @Description:Comment for non-overriding methods * @author 张颖辉 * @date ${date}${time} * ${tags} */ /* (non-Javadoc) * ${see_to_overridden} */ /** * ${tags} * ${see_to_target} */ ${filecomment}${package_declaration}${typecomment}${type_declaration} // ${todo} Auto-generated catch block${exception_var}.printStackTrace(); // ${todo} Auto-generated method stub${body_statement} ${body_statement}// ${todo} Auto-generated constructor stub return ${field}; ${field} = ${param};
可以本地创建xml文件,在上面设置模板的对话框中导入该xml文件。