aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes How to Automatically Add Java Doc Comments in Eclipse? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to Automatically Add Java Doc Comments in Eclipse?" Watch "How to Automatically Add Java Doc Comments in Eclipse?" New topic
Author

How to Automatically Add Java Doc Comments in Eclipse?

Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
I am trying to add @param, @return, etc. in my Java files. I have tried to use Shift + ALT + J but nothing is generated.

Please advise. Thank you.
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Keep cursor before your method and type /** and press enter
nag veni
Greenhorn

Joined: Sep 07, 2011
Posts: 2
if you want to generate a javadoc for a specific method in eclipse then just move your cursor one line above that particular method of a class and type /** and press enter key...am not sure if you are expecting for the same....
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Hi Nag,

Welcome to the Ranch ....
Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
Thanks for the feedback.
nag veni
Greenhorn

Joined: Sep 07, 2011
Posts: 2
Thank you John.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39409
    
  28
I would suggest you set up a template for a method, and include the /** ...@param...@return...@etc... */ in that template. Also put $ tags for name of method, parameters, method body etc in the template. Rather than writing the name of the method, you can use an abbreviation, and Eclipse will give you the skeleton for a method ready-made.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39409
    
  28
When you use the new class wizard in Eclipse, there is a link on it. It says "configure templates and default values here". You can probably set templates for new comments there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Automatically Add Java Doc Comments in Eclipse?