From 621cce7fdf0e325d8789dec762e448844ba0feae Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Mon, 24 Dec 2012 10:09:33 +0000 Subject: Add methods to Messager now dependents are in place. 2012-12-19 Andrew John Hughes * javax/annotation/processing/Messager.java: (printMessage(Kind,CharSequence)): Added. (printMessage(Kind,CharSequence,Element)): Likewise. (printMessage(Kind,CharSequence,Element, AnnotationMirror)): Likewise. (printMessage(Kind,CharSequence,Element, AnnotationMirror,AnnotationValue)): Likewise. Signed-off-by: Andrew John Hughes --- ChangeLog | 10 ++++++ javax/annotation/processing/Messager.java | 57 +++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/ChangeLog b/ChangeLog index 86068561f..3f4c463e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-12-19 Andrew John Hughes + + * javax/annotation/processing/Messager.java: + (printMessage(Kind,CharSequence)): Added. + (printMessage(Kind,CharSequence,Element)): Likewise. + (printMessage(Kind,CharSequence,Element, + AnnotationMirror)): Likewise. + (printMessage(Kind,CharSequence,Element, + AnnotationMirror,AnnotationValue)): Likewise. + 2012-12-19 Andrew John Hughes * javax/tools/SimpleJavaFileObject.java: diff --git a/javax/annotation/processing/Messager.java b/javax/annotation/processing/Messager.java index b5366efeb..884b5b374 100644 --- a/javax/annotation/processing/Messager.java +++ b/javax/annotation/processing/Messager.java @@ -37,6 +37,12 @@ exception statement from your version. */ package javax.annotation.processing; +import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.AnnotationValue; +import javax.lang.model.element.Element; + +import static javax.tools.Diagnostic.Kind; + /** * Provides a way for an annotation processor to report * messages to the user. Messages may use elements, @@ -54,4 +60,55 @@ package javax.annotation.processing; */ public interface Messager { + + /** + * Prints a message of the specified kind. + * + * @param kind the kind of message to print. + * @param message the message to print. + */ + void printMessage(Kind kind, CharSequence message); + + /** + * Prints a message of the specified kind at + * the location of the given element. + * + * @param kind the kind of message to print. + * @param message the message to print. + * @param element the element to use for positioning. + */ + void printMessage(Kind kind, CharSequence message, + Element element); + + /** + * Prints a message of the specified kind at the + * location of the annotation mirror of the given + * annotated element. + * + * @param kind the kind of message to print. + * @param message the message to print. + * @param element the annotated element. + * @param annotation the annotation to use for + * positioning. + */ + void printMessage(Kind kind, CharSequence message, + Element element, + AnnotationMirror annotation); + + /** + * Prints a message of the specified kind at the + * location of the annotation value inside the + * annotation mirror of the given annotated element. + * + * @param kind the kind of message to print. + * @param message the message to print. + * @param element the annotated element. + * @param annotation the annotation containing the value. + * @param value the annotation value to use for positioning. + */ + void printMessage(Kind kind, CharSequence message, + Element element, + AnnotationMirror annotation, + AnnotationValue value); + } -- cgit v1.2.1