Java Code Examples for javax.annotation.processing.RoundEnvironment#errorRaised()

The following examples show how to use javax.annotation.processing.RoundEnvironment#errorRaised() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractServiceProviderProcessor.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public @Override final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
    if (roundEnv.errorRaised()) {
        return false;
    }
    if (roundEnv.processingOver()) {
        writeServices();
        outputFilesByProcessor.clear();
        originatingElementsByProcessor.clear();
        return true;
    } else {
        return handleProcess(annotations, roundEnv);
    }
}
 
Example 2
Source File: AbstractGenerator.java    From immutables with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 3
Source File: Processor.java    From immutables with Apache License 2.0 5 votes vote down vote up
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment round) {
  if (!round.processingOver() && !round.errorRaised()) {
    processTemplates(round.getElementsAnnotatedWith(Generator.Template.class));
  }
  return true;
}
 
Example 4
Source File: SpringConfigurationValidationProcessor.java    From spring-configuration-validation-processor with Apache License 2.0 5 votes vote down vote up
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  if (!roundEnv.errorRaised() && !roundEnv.processingOver()) {
    processRound(annotations, roundEnv);
  }
  return false;
}
 
Example 5
Source File: BasicAnnotationProcessor.java    From auto with Apache License 2.0 5 votes vote down vote up
@Override
public final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  checkState(elements != null);
  checkState(messager != null);
  checkState(steps != null);

  // If this is the last round, report all of the missing elements if there
  // were no errors raised in the round; otherwise reporting the missing
  // elements just adds noise the output.
  if (roundEnv.processingOver()) {
    postRound(roundEnv);
    if (!roundEnv.errorRaised()) {
      reportMissingElements(
          ImmutableSet.<ElementName>builder()
              .addAll(deferredElementNames)
              .addAll(elementsDeferredBySteps.values())
              .build());
    }
    return false;
  }

  process(validElements(roundEnv));

  postRound(roundEnv);

  return false;
}
 
Example 6
Source File: NaluProcessor.java    From nalu with Apache License 2.0 4 votes vote down vote up
@Override
public boolean process(Set<? extends TypeElement> annotations,
                       RoundEnvironment roundEnv) {
  try {
    if (roundEnv.processingOver()) {
      if (!roundEnv.errorRaised()) {
        this.validate(roundEnv);
        this.generateLastRound();
        this.store(metaModel);
      }
      this.processorUtils.createNoteMessage("Nalu-Processor finished ... processing takes: " +
                                                this.stopwatch.stop()
                                                              .toString());
    } else {
      if (annotations.size() > 0) {
        for (TypeElement annotation : annotations) {
          if (Application.class.getCanonicalName()
                               .equals(annotation.toString())) {
            handleApplicationAnnotation(roundEnv);
          } else if (BlockController.class.getCanonicalName()
                                          .equals(annotation.toString())) {
            handleBlockControllerAnnotation(roundEnv);
          } else if (CompositeController.class.getCanonicalName()
                                              .equals(annotation.toString())) {
            handleCompositeControllerAnnotation(roundEnv);
          } else if (Controller.class.getCanonicalName()
                                     .equals(annotation.toString())) {
            handleControllerAnnotation(roundEnv);
          } else if (Debug.class.getCanonicalName()
                                .equals(annotation.toString())) {
            handleDebugAnnotation(roundEnv);
          } else if (ErrorPopUpController.class.getCanonicalName()
                                               .equals(annotation.toString())) {
            handleErrorPopUpControllerAnnotation(roundEnv);
          } else if (Filters.class.getCanonicalName()
                                  .equals(annotation.toString())) {
            handleFiltersAnnotation(roundEnv);
          } else if (Handler.class.getCanonicalName()
                                  .equals(annotation.toString())) {
            handleHandlerAnnotation(roundEnv);
          } else if (Module.class.getCanonicalName()
                                 .equals(annotation.toString())) {
            handleModuleAnnotation(roundEnv);
          } else if (Modules.class.getCanonicalName()
                                  .equals(annotation.toString())) {
            handleModulesAnnotation(roundEnv);
          } else if (PopUpController.class.getCanonicalName()
                                          .equals(annotation.toString())) {
            handlePopUpControllerAnnotation(roundEnv);
          } else if (Shell.class.getCanonicalName()
                                .equals(annotation.toString())) {
            handleShellAnnotation(roundEnv);
          } else if (Tracker.class.getCanonicalName()
                                  .equals(annotation.toString())) {
            handleTrackerAnnotation(roundEnv);
          }
        }
      }
    }
  } catch (ProcessorException e) {
    this.processorUtils.createErrorMessage(e.getMessage());
    //    }/
    return true;
  }
  return true;
}