| Author |
eclipse, javadoc and ${tags}
|
christophe seguinot
Greenhorn
Joined: Oct 19, 2007
Posts: 18
|
|
Hello,
In the javadoc template of a method (java -> Code Style -> Code Template : Comments -> Methods) we can have :
Take the following example :
By clicking on ctrl + shift + j, we get :
Extract form the eclipse documentation :
"Comment templates can contain the variable ${tags} that will be substituted by the standard Javadoc tags (@param, @return..) for the commented element."
I would like to customize the template associated to @{tags} in order to add the @link tags.
Does anyone know how to do this or at least if it's possible or maybe the name of the eclipse plugin which is used, some clue perhaps ?
Thanks
Best regards,
Chris
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14487
|
|
Making a template like what you described is easy. Making the link target point somewhere requires that something be able to figure out where that "somewhere" is going to be.
If you were actually just planning to link to the parameter's datatype javadocs, the link tag would be redundant, since the normal javadoc generator already does that.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
B Kelly
Greenhorn
Joined: Aug 13, 2012
Posts: 1
|
|
Similar question: I'd like to customize ${tags} in auto-generated constructors to reference javadoc I write for fields set in the constructor. I do something similar for auto-getters and setters:
/**
* Get the ${bare_field_name}.
* @return the ${bare_field_name}
* @see #${bare_field_name}
*/
/**
* Set the ${bare_field_name}.
* @param ${param} input ${bare_field_name}
* @see #${bare_field_name}
*/
This would be a big time saver, as I would only have to document the fields once instead of repeat or copy paste for multiple constructors. Any straightforward way to do this?
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14487
|
|
Welcome to the JavaRanch B,
Actually, rather than raising a dead topic (zombie), we'd prefer that you start a new one.
It's very easy to customize the autodocs in Eclipse. Just go to Help/Preferences, select Java, Code Style, Code Templates. The items in question are "fields", "getters" and "setters". These are the templates that are used when generating properties and accessor/mutator methods.
|
 |
 |
|
|
subject: eclipse, javadoc and ${tags}
|
|
|