且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何配置Intellij Idea javadoc模板?

更新时间:2021-11-28 00:43:48

打开Generate菜单(Cmd Mac上为+ N,Windows上为Alt + Insert)

Bring up the Generate menu (Cmd+N on Mac, Alt+Insert on Windows)

点击右上角的省略号。

单击左上角的加号并创建一个新模板。

Click the plus in the top left corner and create a new template.

将旧模板的内容复制到新模板中,并将以下行添加到顶部它。

Copy the contents of the old template into the new template and add the following lines to the top of it.

/**
* Gets $field.name
*
* @return value of $field.name
*/

现在,当你生成getter时,使用'New Template',你应该得到你的getter with JavaDoc。

Now when you generate the getter use the 'New Template' and you should get your getter with the JavaDoc.