简体   繁体   English

JavaDoc:@link to MyClass.class

[英]JavaDoc: @link to MyClass.class

Is there correct JavaDoc syntax for {@link Foo.class} ? {@link Foo.class}是否有正确的JavaDoc语法? Neither this, nor {@link Foo#class} works. 既不是这个,也不是{@link Foo#class} 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: 我有一个函数registerException(Class<? extends Exception> exceptionClass) ,它使用registerException(IOException.class)类的东西调用,并开始为它编写以下JavaDoc:

/**
 * 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 . 我在想是否可以在IOException.class周围放置一个{@link ...}

The .class is not needed (and apparently doesn't work). 不需要.class(显然不起作用)。

As noted in a comment, {@link IOException IOException.class} should create a link with an appropriate text label. 正如评论中所述,{@link IOException IOException.class}应该创建一个带有适当文本标签的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM