idea添加注释模板
- file-settings-live Template,添加自己的template group
- 在template group中添加两个template,一个是类的,一个是方法的
- 类模板
/**
* $class$
*
* @author: zhangjikuan
* @date: $Date$ $time$
*/
Name | Expression | Default value | skip |
---|
class | className() | | |
Date | date() | | |
time | time() | | |

/**
* $method$
* $param$
* @return $return$
* @Exception $exception$
* @author zhangjikuan
* @date $date$ $time$
*/
Name | Expression | Default value | skip |
---|
method | methodName() | | |
param | | groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+='\\n * @param ' + params[i] + ' ' + params[i]}; return result", methodParameters()) | |
return | methodReturnType() | | |
exception | | | |
date | date() | | |
time | time() | | |

效果

