Java allows the definition of values in annotations, for example:
public @interface MyAnnotation {
int MyValue();
}
Although it is possible to set a default value for the MyValue
annotation, I was wondering whether it is possible to make it mandatory. What I mean is forcing the user to provide a value for MyValue
when annotating a class or field.
I went through the documentation but could not find anything. Does anyone have a solution to this issue or is it just impossible to make an annotation's value mandatory?