mjs
mjs

Reputation: 22357

Intellij, add @Author or file header on a set of files

I already have lots of code written and I would like to add my custom:

/**
 * @Author 
**/

tag on all java classes.

Intellij adds this when I create new classes but how can I add it if the files are already created?

Upvotes: 1

Views: 3488

Answers (1)

Javaru
Javaru

Reputation: 31936

There is no built in way to add Javadoc to any class that is missing it. And definitely not a way to (directly) say add the @Author tag to any Javadoc missing it.

The ideal way to do what you want would be to use the Structural Search and Replace feature (Ctrl+Shift+M or Edit Search > Replace Structurally) With it, you could run a search & replace to add Javadoc to any class missing it, and then one to add the @Author tag to any class with Javadoc but without the @Author tag.

Take a look at the IntelliJ IDEA help on Structural search and replace. You can also take a look at Structural Search and Replace: What, Why, and How-to and Basics of working with structural search.

Upvotes: 2

Related Questions