Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top