0 Replies Latest reply on Aug 2, 2012 9:11 AM by Thomas Mauch

    How to make public constants within annotations documented?

    Thomas Mauch
      I have defined several public static final fields in my annotation which can be used as constants, e.g.


      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,