| Author |
How to Automatically Add Java Doc Comments in Eclipse?
|
Natalie Kopple
Ranch Hand
Joined: May 06, 2003
Posts: 320
|
|
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: 320
|
|
|
Thanks for the feedback.
|
 |
nag veni
Greenhorn
Joined: Sep 07, 2011
Posts: 2
|
|
|
Thank you John.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
|
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: 32611
|
|
|
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.
|
 |
 |
|
|
subject: How to Automatically Add Java Doc Comments in Eclipse?
|
|
|