How Javadoc Class Individual Enumerations

I am writing javadoc for a class containing its own enumerations. Is there a way to generate javadoc for 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 the listings in general:

The generated javadoc

Is there any way to document each of the HairColor values โ€‹โ€‹separately? Without moving enum to its own class or changing it from an enumeration?

Thanks in advance for your help.

+57
java enums javadoc
Jul 01 2018-11-11T00:
source share
2 answers

You do this just like any other variable that you will javadoc.

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

EDIT:

From Paลญlo Ebermann: Enumeration is a separate class. You cannot include your full documentation in the inclusion class (at least without fixing the standard doclet).

+63
Jul 01 2018-11-11T00:
source share

You can create a link to each listing item. All elements will be listed in javadocs to enumerate the class.

 /** * Colors that can be used * <li>{@link #RED}</li> * <li>{@link #BLUE}</li> */ public enum Color { /** * Red color */ RED, /** * Blue color */ BLUE } 
+40
Apr 24 '14 at 10:52
source share



All Articles