Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AnnotationProcessor option not recorgnized by any processor

I have written an annotation processor. The user can pass an option as parameter for the processor. I can also read this parameter in my annotation processor. So far so good, everything works like expected!

However, I get a warning from the compiler, that the option passed to the annotation processor has not been recorgnized by any annotation processor:

Warning:The following options were not recognized by any processor: '[fragmentArgsLib]'

Actually, my processor has recognized and read this option successfully:

@Override public boolean process(Set<? extends TypeElement> type, RoundEnvironment env) {

    String fragementArgsLib = processingEnv.getOptions().get("fragmentArgsLib");
    ... 
}

I guess I have to say manually that I have used this option to make this compiler warning disappear. Does anyone of you know how to do that?

like image 728
sockeqwe Avatar asked Dec 22 '14 17:12

sockeqwe


1 Answers

Found the answer, you have to specify which options are supported by your annotation processor by overriding getSupportedOptions() or using @SupportedOptions annotation (since java 7)

like image 73
sockeqwe Avatar answered Sep 27 '22 21:09

sockeqwe