How to Javadoc a Class's Individual Enums

Viewed 74198

I am writing the Javadoc for a class that contains its 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:

The generated Javadoc

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

3 Answers

With @see anotation

 /**
 *  Colors that can be used
 *  @see #RED
 *  @see #BLUE
 */
public enum Color {

    /**
     * Red color
     */
     RED,

    /**
     * Blue color
     */
    BLUE
}
Related