7

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?

2
  • Might be just a typo in your post, but your code fragment declares a variable with name fragementArgsLib instead of fragmentArgsLib Commented Dec 22, 2014 at 17:27
  • yes, thats a typo, but that's just a variable name ... the getOptions.get("fragmentArgsLib") is correct and is matching '[fragmentArgsLib]' ... Commented Dec 22, 2014 at 17:29

1 Answer 1

7

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)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.