The IDE adds header information @author

The IDE adds header information @author

Environment Description:

  • eclipse version: Photon Release (4.8.0)
  • idea Version: 2018.03.06

Note distinguish IDE (Integrated Development Environment, Integrated Development Environment) and the idea (IntelliJ IDEA, JAVA software development, that is java IDE, and similar eclipse)

When using coding Ali Statute scanning plug-in scanner codes, we will find such tips, it is because there is no file to add the code in the code creator, creation date information to comment information, this article we look at how the eclipse and idea of ​​setting @author (author) @date (date) information;
Here Insert Picture Description

Set in eclipse

  1. Window-> Preferences, enter the parameter setting page;

  2. Parameter settings left of the page Java-> Code Style-> Code Templates, expand the right side of Comments, click on Types, click on the right Eidt ... to modify the content at the contents, and check the bottom Automatically add comments for new methods and types check box click the lower right corner Apply;

    /* *
     * @author mychangee
     * @date ${currentDate:date('YYYY/MM/dd')}
     */
    

Here Insert Picture Description
3. Create a new java file in eclipse, you can find new file has been @author and @date information;
Here Insert Picture Description

Set in the idea

  1. File-> Settings ..., enter the settings page;

  2. Settings page on the left Editor-> File and Code Temples, to the right in order to select Includes-> File Header (If you do not click on the "+" to create a), fill in the following information on the right side, remember the $ {USER} items into your own name or nickname, otherwise it will use the computer as a current login name value @author, and after completion of the lower right corner click Apply;

   /**
    * @author : ${USER}
    * @date : ${DATE} ${TIME}
    */

Here Insert Picture Description
3. Create a new java file in the current project, this time can be found, the new java file already contains @author and @date information;
Here Insert Picture Description


Arch day a soldier, not Tang donate work!

Published 22 original articles · won praise 0 · Views 235

Guess you like

Origin blog.csdn.net/mychangee/article/details/104481797