This discussion is archived
0 Replies Latest reply: Aug 2, 2012 2:11 AM by 687030 RSS

How to make public constants within annotations documented?

687030 Newbie
Currently Being Moderated
I have defined several public static final fields in my annotation which can be used as constants, e.g.

@MyAnnotation(MyAnnotation.HTML)

The annotation is defined like this:

public @interface MyAnnotation {
     /** HTML-Output */
     public static final int HTML = 0x01;
     /** TXT-Output */
     public static final int TXT = 0x02;

     /** Define output format */
     int format() default TXT;
}

This approach works fine with classes or interfaces where Javadoc generates a field summary which lists all defined public constants.

The constants defined within an annotation seem not to be shown by the Javadoc tool.

Is there a way to make the Javadoc tool a field summary for annotations as it is done for classes or interfaces?

Many thanks,
Thomas

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points