设置注释模板的入口:Window->Preference->Java->Code Style->Code Template

将如下保存在新创建的xml文件中,导入进去

<?xml version="1.0"?>
<templates>
<template
autoinsert="false"
context="filecomment_context"
deleted="false"
description="Comment for created Java files"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.filecomment"
name="filecomment">
/**
* @Title: ${file_name}
* @Package ${package_name}
* @Description:
* @author ${user}
* @date ${date}
* @version V1.0
*/</template>
<template
autoinsert="false"
context="typecomment_context"
deleted="false"
description="Comment for created types"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.typecomment"
name="typecomment">
/**
* @ClassName: ${type_name}
* @Description:
* @author ${user}
* @date ${date}
* @version V1.0
* ${tags}
*/</template>
<template
autoinsert="false"
context="fieldcomment_context"
deleted="false"
description="Comment for fields"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment"
name="fieldcomment">
/**
* @Fields ${field} :
*/</template>
<template
autoinsert="false"
context="constructorcomment_context"
deleted="false"
description="Comment for created constructors"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment"
name="constructorcomment">
/**
* 创建一个新的实例 ${enclosing_type}.
*
* ${tags}
*/</template>
<template
autoinsert="false"
context="methodcomment_context"
deleted="false"
description="Comment for non-overriding methods"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.methodcomment"
name="methodcomment">
/**
* @Title: ${enclosing_method}
* @Description: ${todo}
* @param ${tags}
* @return ${return_type}
* @throws
*/</template>
<template
autoinsert="true"
context="overridecomment_context"
deleted="false"
description="Comment for overriding methods"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.overridecomment"
name="overridecomment">
/* (非 Javadoc)
* <p>Title: ${enclosing_method}</p>
* <p>Description: </p>
* ${tags}
* ${see_to_overridden}
*/</template>
<template
autoinsert="true"
context="delegatecomment_context"
deleted="false"
description="Comment for delegate methods"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment"
name="delegatecomment">
/**
* ${tags}
* ${see_to_target}
*/</template>
<template
autoinsert="false"
context="gettercomment_context"
deleted="false"
description="Comment for getter method"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.gettercomment"
name="gettercomment">
/**
* @return ${bare_field_name}
*/</template>
<template
autoinsert="true"
context="settercomment_context"
deleted="false"
description="Comment for setter method"
enabled="true"
id="org.eclipse.jdt.ui.text.codetemplates.settercomment"
name="settercomment">
/**
* @param ${param} the ${bare_field_name} to set
*/</template>
</templates>

【记录】eclipse / STS 设置注释模版格式/导入注释模版格式的更多相关文章

  1. Eclipse中设置作者日期等Java注释模板

    Eclipse作为JavaIDE(Integrated Development Environment,集成开发环境),可以通过设置自动添加Javadoc注释信息,如@author 作者名.@vers ...

  2. 在Eclipse中设置Java类上面的注释(包含作者、日期等)

    希望在Eclipse中,让Java类上面的注释像下面这样,改如何设置呢? 在Eclipse中,点击菜单中的Window-->Preferences,打开如下窗口:

  3. 【记录】STS设置maven远程仓库,加快下载jar包

    在STS中windows->preferences->maven->user settings 修改user settings里setting.xml配置文件 <?xml ve ...

  4. Eclipse中设置在创建新类时自动生成注释

    方法一:Eclipse中设置在创建新类时自动生成注释 windows-->preference Java-->Code Style-->Code Templates code--&g ...

  5. eclipse/MyEclipse 日期格式、注释日期格式、时区问题

    eclipse/MyEclipse 日期格式.注释日期格式.时区问题 在eclipse/MyEclipse中,如果你的注释或是运行System.out.print(new java.util.Date ...

  6. Eclipse中设置注释、日期等信息

    在使用Eclipse 编写Java代码时,自动生成的注释信息都是按照预先设置好的格式生成的,例如其中author,datetime等属性值. 我们可以在Eclipse 中进行设置自己希望显示的注释信息 ...

  7. 在Eclipse里设置格式化代码时不格式化注释

    在Eclipse里设置格式化代码时不格式化注释 今天格式化代码 发现直接format会把注释也一块格式化了,有时候会把好好的注释弄的很乱.甚为头疼. 查阅之后解决办法如下: Windows -> ...

  8. spring 源码导入eclipse(sts)

    一. 准备工作 1.下载安装sts(springsource推荐使用) 下载地址: http://www.springsource.org/downloads/sts-ggts 2.下载安装gradl ...

  9. 学习记录 Eclipse常用快捷键及其演练

    Eclipse中10个最有用的快捷键组合 1. ctrl+shift+r:打开资源 这可能是所有快捷键组合中最省时间的了.这组快捷键可以让你打开你的工作区中任何一个文件,而你只需要按下文件名或mask ...

随机推荐

  1. React-Native实战项目-导航器篇(一)

    前言:官方文档已经看了一遍,但印象不是很深,于是在mooc上找了个实战学习项目做一做. 本篇目录: 基础导航练习√ 1.ReactNavigation之createStackNavigator导航器案 ...

  2. Java中 Map用法

    public static Map GetGoodTypes() { Map goodTypes=new HashMap(); goodTypes.put(1,"原材料"); go ...

  3. RxJava的学习与实现

    RxJava 要在Android中使用RxJava2, 先添加Gradle配置: compile 'io.reactivex.rxjava2:rxjava:2.0.1' compile 'io.rea ...

  4. day01 html介绍 文档声明头 head标签 body标签

    day01 html   初识html <!--文档的声明--> <!doctype html>   <html lang="en">    # ...

  5. Nginx有哪些作用?

    Nginx有哪些作用? http协议代理 搭建虚拟主机 服务的反向代理 在反向代理中配置集群的负载均衡   什么是正向代理? 正向代理,意思是一个位于客户端和原始服务器(origin server)之 ...

  6. div标准布局示例

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  7. 调用opencv的接口实现人脸检测(简单)

    import cv2 import matplotlib.pyplot as plt %matplotlib inline # 提取预训练的人脸检测模型,提前下载好的模型 face_cascade = ...

  8. shell脚本编程测试类型上

    一bash的条件测试 判断某需求是否满足,需要由测试机制来实现.专用的测试表达式需要由测试命令辅助完成测试过程. 评估布尔声明,以便用在条件性执行中.若真,则返回0:若假,则返回1. 测试命令:• t ...

  9. BZOJ5484: [Usaco2018 Dec]Sort It Out

    5484: [Usaco2018 Dec]Sort It Out https://www.lydsy.com/JudgeOnline/problem.php?id=5484 Sol. 考虑没有在被喊叫 ...

  10. horizontalAccuracy 检测定位成功

    - (void)findCurrentLocation { self.isFirstUpdate = YES; [self.locationManager startUpdatingLocation] ...