Package com.google.auto.value.processor
Class ErrorReporter
java.lang.Object
com.google.auto.value.processor.ErrorReporter
Handle error reporting for an annotation processor.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Abandon the processing of this class if any errors have been output.(package private) void
abortWithError
(String msg, Element e) Issue a compilation error and abandon the processing of this class.(package private) void
reportError
(String msg, Element e) Issue a compilation error.(package private) void
reportNote
(String msg, Element e) Issue a compilation note.(package private) void
reportWarning
(String msg, Element e) Issue a compilation warning.
-
Field Details
-
messager
-
anyErrors
private boolean anyErrors
-
-
Constructor Details
-
ErrorReporter
ErrorReporter(ProcessingEnvironment processingEnv)
-
-
Method Details
-
reportNote
Issue a compilation note.- Parameters:
msg
- the text of the notee
- the element to which it pertains
-
reportWarning
Issue a compilation warning.- Parameters:
msg
- the text of the warninge
- the element to which it pertains
-
reportError
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 warninge
- the element to which it pertains
-
abortWithError
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 errore
- the element to which it pertains
-
abortIfAnyError
void abortIfAnyError()Abandon the processing of this class if any errors have been output.
-