我怎样才能使用@link
标签链接到方法?
我想改变:
/**
* Returns the Baz object owned by the Bar object owned by Foo owned by this.
* A convenience method, equivalent to getFoo().getBar().getBaz()
* @return baz
*/
public Baz fooBarBaz()
to:
/**
* Returns the Baz object owned by the Bar object owned by Foo owned by this.
* A convenience method, equivalent to {@link getFoo()}.{@link getBar()}.{@link getBaz()}
* @return baz
*/
public Baz fooBarBaz()
但我不知道如何格式化@link
正确标记。
您可以在以下位置找到有关 JavaDoc 的更多信息标准 Doclet 的文档注释规范,包括有关的信息
{@link module/package.class#成员标签}
标签(您正在寻找的)。文档中对应的例子如下
例如,下面是引用 getComponentAt(int, int) 方法的注释:
Use the {@link #getComponentAt(int, int) getComponentAt} method.
The module/package.class
如果首选方法在当前类中,则可以省略部分。
有关 JavaDoc 的其他有用链接包括:
- JDK 17 工具规范 - javadoc 命令
- Java文档指南
- 如何为 Javadoc 工具编写文档注释
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)