简体   繁体   English

从 javadoc 中排除方法

[英]Exclude methods from the javadoc

we use the javadoc to generate a test documentation report of our JUnit tests.我们使用 javadoc 生成 JUnit 测试的测试文档报告。 that works so far.到目前为止有效。 But we want to exclude the methods like @BeforeClass @AfterClass @Before @After , but they have to be public.但是我们想排除像@BeforeClass @AfterClass @Before @After这样的方法,但它们必须是公开的。

I've found a similar question in stackoverflow.我在 stackoverflow 中发现了一个类似的问题 I don't want to mark methods as deprecated.我不想将方法标记为已弃用。

We cannot do this for public methods.对于公共方法,我们不能这样做。

Also, a tag might be added, @exclude tag此外,可能会添加一个标签,@ exclude 标签

From Docs.从文档。

@exclude @排除

For API to be excluded from generation by Javadoc.对于要从​​ Javadoc 生成中排除的 API。 Programmer would mark a class, interface, constructor, method or field with @exclude.程序员会用@exclude 标记一个类、接口、构造函数、方法或字段。 Presence of tag would cause API to be excluded from the generated documentation.标签的存在会导致 API 从生成的文档中排除。 Text following tag could explain reason for exclusion, but would be ignored by Javadoc.标签后面的文本可以解释排除的原因,但会被 Javadoc 忽略。 (Formerly proposed as @hide, but the term "hide" is more appropriate for run-time dynamic show/hide capability.) For more discussion, see: Feature Request #4058216 in Developer Connection. (以前提议为@hide,但术语“隐藏”更适合运行时动态显示/隐藏功能。)有关更多讨论,请参阅:Developer Connection 中的功能请求 #4058216

you might get some alternative here .你可能会在这里得到一些替代品。

Actually it appears that this functionality has finally been implemented and the solution is illustrated below by example:实际上,这个功能似乎终于实现了,下面通过示例说明了解决方案:

/**
 * @hidden
 */
@Override
public void run() {
   ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM