Class ErrorReporter

java.lang.Object
com.google.auto.value.processor.ErrorReporter

class ErrorReporter extends Object
Handle error reporting for an annotation processor.
See Also:
  • AutoValue
  • Field Details

    • messager

      private final Messager messager
    • anyErrors

      private boolean anyErrors
  • Constructor Details

  • Method Details

    • reportNote

      void reportNote(String msg, Element e)
      Issue a compilation note.
      Parameters:
      msg - the text of the note
      e - the element to which it pertains
    • reportWarning

      void reportWarning(String msg, Element e)
      Issue a compilation warning.
      Parameters:
      msg - the text of the warning
      e - the element to which it pertains
    • reportError

      void reportError(String msg, Element e)
      Issue a compilation error. This method does not throw an exception, since we want to continue processing and perhaps report other errors. It is a good idea to introduce a test case in CompilationTest for any new call to reportError(...) to ensure that we continue correctly after an error.
      Parameters:
      msg - the text of the warning
      e - the element to which it pertains
    • abortWithError

      void abortWithError(String msg, Element e)
      Issue a compilation error and abandon the processing of this class. This does not prevent the processing of other classes.
      Parameters:
      msg - the text of the error
      e - the element to which it pertains
    • abortIfAnyError

      void abortIfAnyError()
      Abandon the processing of this class if any errors have been output.