有没有办法从方法文档正文中添加对一个或多个方法参数的引用? 比如:
/**
* 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)
{...}
最佳答案
据我了解the docs for javadoc没有这样的功能。
不要使用 <code>foo</code>
按照其他答案的建议;您可以使用 {@code foo}
.当您引用诸如 {@code Iterator<String>}
之类的泛型类型时,了解这一点尤其有用。 -- 确实比 <code>Iterator<String></code>
好看,不是吗!
关于java - 如何在javadoc中添加对方法参数的引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1667212/