How configure Intellij Idea javadoc templates?

后端 未结 6 1458
忘掉有多难
忘掉有多难 2020-12-03 02:57

I have some method:

public int getSomeField()

I want to generate javadoc like this:

/**
* Gets {someField}
*
* @return valu         


        
6条回答
  •  生来不讨喜
    2020-12-03 03:24

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

    Click the ellipsis in the top right hand corner.

    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
    */
    

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

提交回复
热议问题