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
public
final
You probably want processingEnv.getMessager().printMessage(Kind.ERROR, "method wasn't public and final", element).
processingEnv.getMessager().printMessage(Kind.ERROR, "method wasn't public and final", element)
Messager: "Printing a message with an error kind will raise an error."