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

查看:241
本文介绍了有没有办法让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和类似的工具来记录。这种类型应该用于注释类型的注释影响他们的客户使用注释元素的声明。如果一个类型声明归档的注解,注解它成为注释元素的公共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天全站免登陆