我有两种方法,其中一种方法是另一种方法的简单代理,带有一些默认参数:
/**
* do the foo
* @param bar preprocess object baz
* @param baz the object we are working on
*/
public void foo(boolean bar, Object baz) {}
/**
* do the foo, with preprocessing.
* See {@link #foo(boolean, Object)}
* @param baz the object we are working on
*/
public void foo(Object baz) {
foo(true, baz);
}
这里,第二个方法 foo(Object)是* foo('true',Object)的便捷快捷方式。
问:如何在javadoc中声明?我的意思是将See {@link #foo(boolean, Object)}
替换为{@link #foo(true, Object)
? (但是,从语法上讲,后者是不正确的。)
答案 0 :(得分:1)
@link
构造允许您显示任意文本,同时仍链接到适当的Java元素:
/**
* do the foo, with preprocessing.
* See {@link #foo(boolean, Object) foo(true, Object)}
* @param baz the object we are working on
*/
public void foo(Object baz) {
foo(true, baz);
}