示例#1
0
 @Override
 @Nullable
 public Invokable invoke(Invokation invokation, Object... parameters) {
   String message = CharMatcher.WHITESPACE.trimFrom(parameters[0].toString());
   StaticEnvironment.processing().getMessager().printMessage(Diagnostic.Kind.ERROR, message);
   return null;
 }
 @Override
 public final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment round) {
   try {
     StaticEnvironment.init(annotations, round, processingEnv);
     if (!round.processingOver() && !round.errorRaised()) {
       process();
     }
     StaticEnvironment.shutdown();
   } catch (Exception ex) {
     processingEnv
         .getMessager()
         .printMessage(
             Diagnostic.Kind.ERROR,
             getClass().getName() + " threw " + Throwables.getStackTraceAsString(ex));
   }
   return false;
 }
 protected final Set<TypeElement> annotations() {
   return StaticEnvironment.annotations();
 }
 protected final RoundEnvironment round() {
   return StaticEnvironment.round();
 }
 protected final ProcessingEnvironment processing() {
   return StaticEnvironment.processing();
 }
示例#6
0
 private static Files getFiles() {
   return StaticEnvironment.getInstance(Files.class, FilesSupplier.INSTANCE);
 }
示例#7
0
 private static Messager getMessager() {
   return StaticEnvironment.processing().getMessager();
 }
示例#8
0
 private static Filer getFiler() {
   return StaticEnvironment.processing().getFiler();
 }