Repeatable

  • The @Repeatable annotation is used to indicate that an annotation type can be applied multiple times to the same declaration.

  • @Repeatable's value method specifies the container annotation type that holds the repeated annotations.

  • It's a meta-annotation, meaning it annotates other annotation types.

  • @Repeatable leverages container annotations to store multiple instances of the repeatable annotation.

public abstract @interface Repeatable implements Annotation

The annotation type java.lang.annotation.Repeatable is used to indicate that the annotation type whose declaration it (meta-)annotates is repeatable. The value of @Repeatable indicates the containing annotation type for the repeatable annotation type.

Public Method Summary

Class<? extends Annotation>
value()
Indicates the containing annotation type for the repeatable annotation type.

Inherited Method Summary

Public Methods

public Class<? extends Annotation> value ()

Indicates the containing annotation type for the repeatable annotation type.

Returns
  • the containing annotation type