I have made a custom annotation in java that takes one value (String[]);
@Retention(value = RetentionPolicy.RUNTIME)
public @interface MyAnnotation{
String[] value ();
}
however, I want the values-when I use MyAnnotation-to be like this: aClassName.anAttribute
- aClassName is the name of a class in my application
anAttribute is one of it's attributes which is a String:
public static String anAttribute1="aStringxxx";
But I get an error: The value for annotation attribute MyAnnotation.value must be a constant expression
Does anyone have an idea please?
String[]rather thanString?