• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Automatically Add Java Doc Comments in Eclipse?

 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keep cursor before your method and type /** and press enter
 
nag veni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nag,

Welcome to the Ranch ....
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the feedback.
 
nag veni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you John.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49813
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49813
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic