How to reuse javadoc for similar functions

牧云@^-^@ 提交于 2019-12-06 09:33:11
Social_Engineerer

What about using @see tag and pointing to the original, non-overloaded method? Then in the overloaded method you can just use the @param value.

/**
*@see #yourMethod()
*/

This sought of functionality unfortunately isn't supported by JavaDoc. Instead what I do is fully document the method with the most parameters, then link my defaulting methods:

/**
 * {@code parameter} defaults to null.
 *
 * @see MyClass#somethingImportant(String)
 */
public void somethingImportant()

As an aside; if the methods you are docing are implementations of an interface or an override you can use the {@inheritDoc} tag.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!