This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Automatically Add Java Doc Comments in Eclipse?

 
Natalie Kopple
Ranch Hand
Posts: 325
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nag,

Welcome to the Ranch ....
 
Natalie Kopple
Ranch Hand
Posts: 325
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the feedback.
 
nag veni
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you John.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47250
52
  • 0
  • 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: 47250
52
  • 0
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic