Intellij generate javadoc for methods and classes

JavaIntellij IdeaJavadocAuto Generate

Java Problem Overview


Is it possible to set up Intellij to generate javadoc for methods and classes, automatically, with @author and @since date? I had this feature in Eclipse.

I know that the files have templates and also I can manually semi-automatically add javadoc to selected method/class. But I want the generation to be automatic for every generated method/class/enum/interface/field etc.

This is useful for e.g. "extract method", "override/implement", "create getter/setter" etc. This would save hundreds of manual actions.

I'm using IntelliJ Idea 9.0 BETA Community Edition, #IC-90.96.

Java Solutions


Solution 1 - Java

For IntelliJ 12:

> Position caret above a method name, type /** and press Enter to let > IntelliJ IDEA automatically generate JavaDoc stubs for this method. > See here

Solution 2 - Java

For newer versions of IntelliJ (2018+), you can use this solution:

Typing /** + then pressing Enter above a method signature will create Javadoc stubs for you.

Solution 3 - Java

It's not possible at the moment. You may want to Vote for IDEABKL-1787.

Solution 4 - Java

for generate javadoc in intellij Idea go to Tools->Generate JavaDoc (4th option) click it and give path to save your Document

Solution 5 - Java

I have given up on hoping that IntelliJ will be able to do this. I now open my project in Eclipse, go to the desired files and invoke JAutoDoc.

Solution 6 - Java

Now there is a new plugin available for that. It works great, you can generate javadoc with alt+insert.

It's called "javaDoc", it's available directly in the plugin section. The documentation is here : https://github.com/setial/intellij-javadocs/wiki

Solution 7 - Java

There is JavaDoc Sync Plugin 8. http://plugins.intellij.net/plugin/?idea&id=3403 Generates javadoc for all methods in class. Works in Idea 10.

Solution 8 - Java

Actually it's now possible, you can simply go to "Settings/Editor/File and Code Templates". There, you can edit the template which is used to create classes, enums, interfaces etc. My Intellij version is 2019.2.3 and on linux.

Solution 9 - Java

An easy option is to access Find Action menu (Macs: Cmd+Shift+A | Win: Ctrl+Shift+A) and type any part of the Generate JavaDoc action. Once you found and clicked on that , an option menu for generation of JavaDocs is opened , containing a wide range of options and scopes.

Reference -> https://www.jetbrains.com/help/idea/mastering-keyboard-shortcuts.html

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKarolDepkaView Question on Stackoverflow
Solution 1 - JavachanceView Answer on Stackoverflow
Solution 2 - JavaaelkzView Answer on Stackoverflow
Solution 3 - JavaCrazyCoderView Answer on Stackoverflow
Solution 4 - JavarinkeshView Answer on Stackoverflow
Solution 5 - JavaEvvoView Answer on Stackoverflow
Solution 6 - JavaDamianView Answer on Stackoverflow
Solution 7 - JavaAlexey ShukView Answer on Stackoverflow
Solution 8 - JavaAhmad SajadianView Answer on Stackoverflow
Solution 9 - JavaIvo VarbanovView Answer on Stackoverflow