Eclipse注释模板设置方法
设置注释模板的入口:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素。
文件(Files)注释标签:
1
2
3
4
5
6
7
8
|
/**
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(用一句话描述该文件做什么)
* @author ${user}
* @date ${date}
* @version V1.0
*/
|
类型(Types)注释标签(类的注释):
1
2
3
4
5
6
7
8
|
/**
* @ClassName: ${type_name}
* @Description: ${todo}(这里用一句话描述这个类的作用)
* @author ${user}
* @date ${date}
*
* ${tags}
*/
|
字段(Fields)注释标签:
1
2
3
|
/**
* @Fields ${field} : ${todo}(用一句话描述这个变量表示什么)
*/
|
构造函数(Constructor)标签:
1
2
3
4
5
|
/**
* 创建一个新的实例 ${enclosing_type}.
*
* ${tags}
*/
|
方法(Methods)标签:
1
2
3
4
5
6
7
|
/**
* @Title: ${enclosing_method}
* @Description: ${todo}(这里用一句话描述这个方法的作用)
* @param ${tags} 参数
* @return ${return_type} 返回类型
* @throws
*/
|
覆盖方法(Overriding Methods)标签:
1
2
3
4
5
6
|
/* (非 Javadoc)
* <p>Title: ${enclosing_method}</p>
* <p>Description: </p>
* ${tags}
* ${see_to_overridden}
*/
|
代理方法(Delegate Methods)标签:
1
2
3
4
|
/**
* ${tags}
* ${see_to_target}
*/
|
getter方法标签:
1
2
3
|
/**
* @return ${bare_field_name}
*/
|
setter方法标签:
1
2
3
|
/**
* @param ${param} the ${bare_field_name} to set
*/
|
要实现上面的注释模板,这需要将下面的配置文件导入就可以了:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
<?xml version="1.0" encoding="UTF-8"?>
<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: ${todo}(用一句话描述该文件做什么)
* @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: ${todo}(这里用一句话描述这个类的作用)
* @author ${user}
* @date ${date}
*
* ${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} : ${todo}(用一句话描述这个变量表示什么)
*/
</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注释模板设置方法的更多相关文章
- 【转载】 Eclipse注释模板设置详解
Eclipse注释模板设置详解 网站推荐: 金丝燕网(主要内容是 Java 相关) 木秀林网(主要内容是消息队列)
- Eclipse注释模板设置详解
设置注释模板的入口:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素 ...
- [Java] Eclipse注释模板设置详解
设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元 ...
- eclipse注释模板设置(未整理)
Window --> Java --> Code Style --> Code Templates --> Comments --> types --> Edit ...
- Eclipse注释模板设置
设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元 ...
- eclipse 注释模板设置
方法注释模板 /** * @title ${enclosing_method} * @description ${todo} * ${tags} ${return_type} * @Date ${da ...
- 【转】Eclipse Java注释模板设置详解
Eclipse Java注释模板设置详解 设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后 ...
- Eclipse Java注释模板设置详解以及版权声明
网上的Eclipse注释模板,在这里稍稍整理一些比较常用的. 编辑注释模板的方法:Window->Preference->Java->Code Style->Code Temp ...
- IDEA中设置注释模板的方法
IDEA中设置注释模板主要分为两个部分,分别是创建java文件时类的注释和方法的注释. 这里为大家详细介绍一下方法,按MyEclipse的风格设置(MyEclipse的请看:MyEclipse中设置注 ...
随机推荐
- 浅谈jQuery Pagination Ajax 分页插件的使用
插件介绍 此插件是jQuery的ajax分页插件.分页切换时无刷新也无延迟,因为是一次性加载的.如果你用到此插件作分页的时候,涉及到的数据量大,建议不要使用此插件,因为加载慢会导致用户体验不好! 插件 ...
- 小程序server-实现会话层
小程序server-实现会话层开发教程: 1.安装MongoDB #安装 MongoDB及其客户端命令行工具 yum install mongodb-server mongodb -y #查看版本 m ...
- C语言开发面试题
(以下是题主参加的一家偏向Linux平台开发的公司软件岗位笔试题,分享原题,后面附上题主91分的部分参考答案^V^) 一.(8分)请问一下程序输出什么结果? char *getStr(void) { ...
- 30. leetcode 121. Best Time to Buy and Sell Stock
121. Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of ...
- JavaScript中的数组Array方法
push(),pop()方法 push(),pop()方法也叫栈方法,push()可以理解成,向末尾推入,而pop()恰好相反,可以理解成从末尾移除(取得). var nums=[1,2,3,4]; ...
- <Mastering KVM Virtualization>:第一章 了解Linux虚拟化
本章为读者提供了Linux虚拟化中流行技术的深刻见解,以及相较于其他同类技术的优势特点.本书共有14章,囊括了KVM虚拟化中的各个方面,从KVM的内部构造开始,并包括了诸如软件定义网络(SDN),性能 ...
- 前端到后台ThinkPHP开发整站(完)
久违了,今天终于抽空把最后的写完了,这是这个项目的最后一篇文章了,把前台的栏目控制器和文章内容控制器的功能实现了. 栏目控制器: <?php namespace Home\Controller; ...
- 【HOSTS相关】前端提供测试模板地址
在测试接口的时候,首先需要绑定HOSTS,这个文件的位置在这个目录的下面:C:\WINDOWS\system32\drivers\etc,打开hosts文件的方式选择"记事本"就可 ...
- WebSphere之Web Server插件
WebSphere之Web Server插件 -----------------------------------2013/10/19 这里记录一下WebSphere与IHS的安装集成,和Web S ...
- 页面引入css用link和import的区别
假设有一个css文件a.css,文件里的内容如下: p { font-size: 18px; } 现在分别使用两种方式引入a.css: 1.使用html的link标签 <link rel=&qu ...