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