throw new LayerGenerationException("Only static string constant fields can be annotated", e, processingEnv, ar); if (ar.key().length() != 0) { throw new LayerGenerationException("When annotating field, one cannot define key()", e, processingEnv, ar, "key"); throw new LayerGenerationException("Inner class annotated with @ActionRegistration has to be static", e); key = ar.key(); } else { assert e.getKind() == ElementKind.METHOD : e; builder.instanceFile("dummy", null, ActionListener.class, ar, null); key = ar.key();