In my web project using CDI, Netbeans 7.1.2 warns on my custom qualifier
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({FIELD, TYPE, METHOD})
public @interface MyQualifier{
}
with message:
The CDI Annotation is declared as Qualifier but it has wrong target values. Correct target values are '{METHOD, FIELD, PARAMETER, TYPE'} or '{FIELD, PARAMETER'}.
Yes it is only warning but still I am curious about the meaning of this message. Could not find any good reference on @Target in the net. So someone here can give some explanation about the Target and the warning message. Thanks.
It looks like, according to section 2.3.2 of the CDI spec they’re both incorrect. A qualifier must be METHOD, FIELD, PARAMETER, TYPE.