Is there correct JavaDoc syntax for {@link Foo.class}? Neither this, nor {@link Foo#class} works. Or is this not possible?

Let me expand a bit:

I have a function registerException(Class<? extends Exception> exceptionClass) that get's called with things like registerException(IOException.class) and started writing the following JavaDoc for it:

/**
 * Registers a new {@link Class Class&lt;? extends Exception&gt;}
 * (e.g. <code>IOException.class</code>} that can be flattened by this handler.
 * 
 * @param exceptionClass - the exception class
 */

and I was thinking whether I could place a {@link ...} around IOException.class.

有帮助吗?

解决方案

The .class is not needed (and apparently doesn't work).

As noted in a comment, {@link IOException IOException.class} should create a link with an appropriate text label.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top