ripper234 ripper234 - 1 year ago 94
Java Question

How to add reference to a method parameter in javadoc?

Is there a way to add references to one or more of a method's parameters from the method documentation body?
Something like:

* When {@paramref a} is null, we rely on b for the discombobulation.
* @param a this is one of the parameters
* @param b another param
void foo(String a, int b)

Answer Source

As far as I can tell after reading the docs for javadoc there is no such feature.

Don't use <code>foo</code> as recommended in other answers; you can use {@code foo}. This is especially good to know when you refer to a generic type such as {@code Iterator<String>} -- sure looks nicer than <code>Iterator&lt;String&gt;</code>, doesn't it!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download