【2011.9.20】java代码注释的模板使用
转载
导入模板:
Window->Preferences->Java->Code Style->Code Templates
-->Comments-->Import-->找到写好的模板
使用的时候
新建一个类的时候勾选住comments,然后点击here,Apply即可
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<template autoinsert="true" context="fieldcomment_context" deleted="false" description="Comment for fields" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name="fieldcomment">/** * */</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>
<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">/* (non-Javadoc) * ${see_to_overridden} */</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">/***************************************************************************************************** * Description : * * Parameters : * * Return Value : * * Modification Log: * Date Author Description * ------------------------------------------------------------ * ${date} Infosys (${user}) Created * ****************************************************************************************************/</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">/***************************************************************************************************** * Functionality Description : * * External Objects called : * * Known Bugs : None * * Modification Log * Date Author Description * ------------------------------------------------------------ * ${date} Infosys (${user}) Created * ****************************************************************************************************/</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="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/* ==================================================================== * * Copyright (c) 2010 Infosys Technologies Ltd, Bangalore. All rights * reserved. * * Use is subject to license terms. */</template>
<template autoinsert="true" context="constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name="constructorcomment">/** * ${tags} */</template>
<template autoinsert="true" context="gettercomment_context" deleted="false" description="Comment for getter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment">/** * @return the ${bare_field_name} */</template>
</templates>
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。