您当前的位置:首页 > 计算机 > 编程开发 > Java

Java Standard 编程推荐标准规范

时间:12-14来源:作者:点击数:

类头注释

/**
 * ${PACKAGE_NAME}@${PROJECT_NAME}
 *
 * <h1>TODO what you want to do?</h1>
 *
 * date ${YEAR}-${MONTH}-${DAY} ${TIME}
 *
 * @author DingPengwei[www.dingpengwei@foxmail.com]
 * @since DistributionVersion
 * @version 1.0.0
 */

方法注释

注释内容

**
 * <h2>TODO what you want to do</h2>
 * date $year$-$month$-$day$ $time$   
 *
$params$
$return$
 * @author DingPengwei[www.dingpengwei@foxmail.com]
 * @since DistributionVersion
 */

参数脚本

groovyScript("if(\"${_1}\".length() == 2) {
return '';
} else {def result='';
def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList();
for(i = 0; i < params.size(); i++) {
if(i<(params.size()-1)){
result+=' * @param ' + params[i] + ' ' + '\\n'
}else{
result+=' * @param ' + params[i] + ' '
}
};
return result;
}", methodParameters());

返回值脚本

groovyScript("def returnType = \"${_1}\";
def result = ' * @return ' + returnType; return result;", methodReturnType());

操作过程

CodeStyle

Google 规范仓库 导入即可

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门
本栏推荐