AnnotationProcessor is not reconstructed by any processor

I wrote an annotation handler. The user can pass a parameter as a parameter to the processor. I can also read this parameter in my annotation handler. So far so good, everything works as expected!

However, I get a warning from the compiler that the parameter passed to the annotation processor was not reconstructed by any annotation processor:

Warning. The following parameters were not recognized by any processor: '[FragmentArgsLib]'

In fact, my processor has successfully recognized and read this option:

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

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

I think I have to say manually that I used this option to eliminate this compiler warning. Do any of you know how to do this?

+4
source share
1 answer

If you find the answer, you must indicate which parameters are supported by your annotation processor, overriding getSupportedOptions()or using annotation @SupportedOptions(starting with java 7)

+4
source

Source: https://habr.com/ru/post/1568647/


All Articles