如何引用在Javadoc方法参数? [英] How to reference a method parameter in javadoc?

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

问题描述

有引用从方法文档体方法参数的一种方式?
是这样的:

  / **
 *如果{@paramref一个}为空,我们依靠b表示discombobulation。
 *
 * @参数一这是参数之一
 * @参数b另一个参数
 * /
无效美孚(String的形式,INT B)
{...}


解决方案

据我可以告诉阅读的的javadoc的对文档没有这样的功能。

不要使用&LT; code基富&LT; / code&GT; 在其他的答案建议;您可以使用 {@ code富} 。这是特别好知道,当你引用泛型类型,如 {@ code的Iterator&LT;弦乐&GT;} - 肯定看起来比更好&LT; code&GT;迭代器和放大器; LT;弦乐和放大器; GT;&LT; / code&GT; <!/ code>,不是

Is there a way to reference one of the method 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)
{...}

解决方案

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

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天全站免登陆