有没有办法让 javadoc 工具记录注释? [英] Is there a way to get the javadoc tool to document annotations?

查看:46
本文介绍了有没有办法让 javadoc 工具记录注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我们使用了许多在 javadoc API 文档中看到的非常有用的注释.

In my project, we use a number of annotations that would be very useful to see in the javadoc API documentation.

有人知道在生成的 javadoc 中包含注释的简单方法吗?我不想编写自己的 javadoc 插件.有什么解决办法吗?

Does anyone know a simple way to include annotations in generated javadocs? I don't want to write my own javadoc plugin. Are there any solutions out there?

推荐答案

参见 java.lang.annotation.Documented

表示默认情况下,带有类型的注解将由 javadoc 和类似工具记录.此类型应用于注释类型声明,这些类型的注释会影响其客户端对带注释元素的使用.如果类型声明使用 Documented 进行注释,则其注释将成为带注释元素的公共 API 的一部分.

Indicates that annotations with a type are to be documented by javadoc and similar tools by default. This type should be used to annotate the declarations of types whose annotations affect the use of annotated elements by their clients. If a type declaration is annotated with Documented, its annotations become part of the public API of the annotated elements.

示例:

import java.lang.annotation.Documented;

@Documented
public @interface MyAnnotation {
}

这篇关于有没有办法让 javadoc 工具记录注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆