Home | History | Annotate | Download | only in meta
      1 package javax.annotation.meta;
      2 
      3 import java.lang.annotation.Documented;
      4 import java.lang.annotation.Retention;
      5 import java.lang.annotation.RetentionPolicy;
      6 
      7 /**
      8  * This annotation can be applied to the value() element of an annotation that
      9  * is annotated as a TypeQualifier. This is only appropriate if the value field
     10  * returns a value that is an Enumeration.
     11  *
     12  * Applications of the type qualifier with different values are exclusive, and
     13  * the enumeration is an exhaustive list of the possible values.
     14  *
     15  * For example, the following defines a type qualifier such that if you know a
     16  * value is neither {@literal @Foo(Color.Red)} or {@literal @Foo(Color.Blue)},
     17  * then the value must be {@literal @Foo(Color.Green)}. And if you know it is
     18  * {@literal @Foo(Color.Green)}, you know it cannot be
     19  * {@literal @Foo(Color.Red)} or {@literal @Foo(Color.Blue)}
     20  *
     21  * <code>
     22  * @TypeQualifier  @interface Foo {
     23  *     enum Color {RED, BLUE, GREEN};
     24  *     @Exhaustive Color value();
     25  *     }
     26  *  </code>
     27  */
     28 
     29 @Documented
     30 @Retention(RetentionPolicy.RUNTIME)
     31 public @interface Exhaustive {
     32 
     33 }
     34