Annotation Processor, generating a compiler error

后端 未结 1 981
-上瘾入骨i
-上瘾入骨i 2020-12-13 19:32

I\'m trying to create a custom annotation that, for example, ensures that a field or method is both public and final, and would generate a compile

相关标签:
1条回答
  • 2020-12-13 20:30

    You probably want processingEnv.getMessager().printMessage(Kind.ERROR, "method wasn't public and final", element).

    Messager: "Printing a message with an error kind will raise an error."

    0 讨论(0)
提交回复
热议问题