当前位置:网站首页>Idea add class annotation template and method template

Idea add class annotation template and method template

2022-07-07 07:41:00 Cooked snail

Catalog

One 、 Class

Two 、 Template on method


One 、 Class

File----------->settings------------------>Editor------------->File and Code Templates

The comments on the class are as follows

/**
 * @description: TODO 
 * @author xiaojie
 * @date ${DATE} ${TIME}
 * @version 1.0
 */

Two 、 Template on method

 4 Situated * Shortcut keys for methods , When using, input /* Then the Enter key

6 The code at is as follows

** 
 * @description: $description$
 * @param: $params$
 * @return: $returns$
 * @author xiaojie
 * @date: $date$ $time$
 */

modify 7 Parameters at

 params The corresponding content is

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

 return The corresponding content is

methodReturnType()

On the class ** Method repeat the above steps , The way to use it is to enter /** Then press enter

**
 * @description: TODO
 * @author xiaojie
 * @date $date$ $time$
 * @version 1.0
 */

The final effect is as follows

 

原网站

版权声明
本文为[Cooked snail]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070349151544.html