如何Javadoc一个类的个人枚举 [英] How to Javadoc a Class's Individual Enums

查看:1037
本文介绍了如何Javadoc一个类的个人枚举的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为包含它自己的枚举的类编写javadoc。有没有办法为各个枚举生成javadoc?例如,现在我有这样的东西:

  / ** 
*这个文件HairColor
* /
private static枚举HairColor {BLACK,BLONDE,BROWN,OTHER,RED};

但是,这只会将所有的枚举作为一个整体:





有没有办法单独记录每个HairColor值?没有将枚举移动到自己的类或从枚举中更改?



提前感谢任何帮助。

解决方案

您可以像任何其他变量一样使用javadoc。

 

/ **
*可以使用的颜色
* /
public enum颜色
{
/ **
*红色颜色
* /
红色,

/ **
*蓝色
* /
蓝色

}

编辑:



从PaŭloEbermann:枚举是一个单独的类。您不能将其完整的文档包含在封闭类中(至少没有修补标准的doclet)。


I am writing the javadoc for a class that contains it's own enums. Is there a way to generate javadoc for the individual enums? For example, right now I have something like this:

/**
 * This documents "HairColor"
 */
private static enum HairColor { BLACK, BLONDE, BROWN, OTHER, RED };

However, this only documents all of the enums as a whole:

Is there any way to document each of the HairColor values individually? Without moving the enum into it's own class or changing it from an enum?

Thanks in advance for any help.

解决方案

You do it just like any other variable you would javadoc.


/**
 *  Colors that can be used
 */
public enum Color
{
    /**
     * Red color
     */
    red,

    /**
     * Blue color
     */
    blue

}

EDIT:

From Paŭlo Ebermann : The enum is a separate class. You can't include its full documentation in the enclosing class (at least, without patching the standard doclet).

这篇关于如何Javadoc一个类的个人枚举的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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