Idea quickly generates class annotations and method annotation templates

Idea quickly generates class annotations and method annotations

  This blog should have been written when I first used IDEA. But I have forgotten it. When I used the new api interface document generation tool JApiDocs today, I saw that there are coding specifications and annotation specifications on it. I remembered the methods in the IDEA class Quickly generate notes in the middle. Recall, write a blog to record records.  

1. Effect picture

2. Quickly generate class comments

 File ---> Settings... (or shortcut key Ctrl+Alt+S) to enter the settings page 

 

 

 template

1

2

3

4

5

6

7

8

/**

*@ClassName: ${NAME}

*@Description: ${description}

*@Author

*@Date ${DATE}

*@Version 1.0

*

*/

  1. ${NAME}: Set the class name, the same as the following ${NAME} to get the created class name

  2. TODO: The mark of the to-do item, generally the generation class or method needs to add a description

  3. ${USER}, ${DATE}, ${TIME}: Set the user who created the class, the date and time of creation, these are the methods built in IDEA, and there are some other methods in the green box, such as You can use ${PROJECT_NAME} if you want to add a project name

  4. 1.0: set the version number, generally the newly created class is version 1.0, just write it dead here

  The rest can go to Baidu by themselves

Three. Quickly generate method notes

 File ---> Settings... (or shortcut key Ctrl+Alt+S) to enter the settings page 

 

 

 template

1

2

3

4

5

6

7

8

*

 @Author xxx

 @Description

 @Date  $date$

 @Param $param$

 @Return $return$

 @MethodName $methodName$

 *

  Note that it begins with *, not /**. The parameter in the method comment template is $ $, and the one in the class is ${ }. 

  LiveTemplate is still very easy to use. Many common and commonly used code modules can be set as templates, and you can directly enter the shortcut keys when you use them in the future. 

Guess you like

Origin blog.csdn.net/zy103118/article/details/109283929