如何在javadoc中添加对方法参数的引用? [英] How to add reference to a method parameter in javadoc?

查看:29
本文介绍了如何在javadoc中添加对方法参数的引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从方法文档正文中添加对一个或多个方法参数的引用?类似的东西:

Is there a way to add references to one or more of a method's parameters from the method documentation body? Something like:

/**
 * 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)
{...}

推荐答案

据我所知 javadoc 的文档 没有这样的功能.

As far as I can tell after reading the docs for javadoc there is no such feature.

不要像其他答案中推荐的那样使用 foo;你可以使用 {@code foo}.当您引用诸如 {@code Iterator<String>} 之类的泛型类型时,了解这一点尤其有用——当然看起来比 Iterator&lt;String> 更好;</code>,不是吗!

Don't use <code>foo</code> as recommended in other answers; you can use {@code foo}. This is especially good to know when you refer to a generic type such as {@code Iterator<String>} -- sure looks nicer than <code>Iterator&lt;String&gt;</code>, doesn't it!

这篇关于如何在javadoc中添加对方法参数的引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆