Annotation Type Comments


Adds comments to a configuration entry or type.

This annotation can be repeated multiple times to specify comments in different locations. Writing this annotation multiple times for the same location will append additional comments at that location.

Usage on a method

This annotation is frequently applied to configuration methods. If applied, the comments will be attached to that method where it is declared (due to the nature of Java inheritance, comments may need to be re-specified if the method is overidden).

Usage on a class

This annotation can also be applied to a class. If the annotated class is used as a configuration interface, the comments specified will become top-level comments in the configuration definition (e.g., header and footer).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    The repeatable annotations container for adding multiple comments.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    @NonNull String @NonNull []
    The comments themselves.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Where the comments should be located.
  • Element Details

    • value

      @NonNull String @NonNull [] value
      The comments themselves. Each value in the array will be placed on a new line.
      Returns:
      the comments to add
    • location

      @NonNull CommentLocation location
      Where the comments should be located.

      This function will add the comments on the corresponding data entry via DataEntry.withComments(CommentLocation, List) using the given location, merging with existing comments at that location as necessary.

      If no location is specified, the default is ABOVE.

      Returns:
      where to place the comments
      Default:
      ABOVE