问题描述
在处理JavaDocs时,何时使用 @see
?它的用途是什么?
When do I use @see
when dealing with JavaDocs? What is its usage?
例如,如果 MethodA
调用 MethodB
然后我必须在 MethodB
的javadoc和参考 MethodA中放入
因为这就是所谓的,或者我必须从 @see
MethodA $ c $中引用
MethodB
c>因为它正在调用它。我在Oracle网站上看过关于 @see
的内容,在我看来它非常模糊,它说这意味着也看到了但不是真的意味着什么!
For example if MethodA
calls MethodB
then do I have to put @see
in MethodB
's javadoc and reference MethodA
because that is what called it, or do I have to put a reference to MethodB
from MethodA
because it's calling it. I've read the stuff about @see
on the Oracle website and it seems to me to be incredibly vague, it says it means "see also" but not really what that means!
推荐答案
是的,它很模糊。
你应该无论何时对于方法文档的读者使用它,也可以查看其他方法。如果你的方法A的文档说像方法B一样工作但是......,那么你肯定应该建立一个链接。
@see
的替代方案是内联 {@ link ...}
标记:
You should use it whenever for readers of the documentation of your method it may be useful to also look at some other method. If the documentation of your methodA says "Works like methodB but ...", then you surely should put a link.An alternative to @see
would be the inline {@link ...}
tag:
/**
* ...
* Works like {@link #methodB}, but ...
*/
当methodA调用methodB的事实是一个实现细节,并且有与外界没有真正的关系,你不需要这里的链接。
When the fact that methodA calls methodB is an implementation detail and there is no real relation from the outside, you don't need a link here.
这篇关于在JavaDoc中使用@see?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!