diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | javax/annotation/processing/Messager.java | 57 |
2 files changed, 67 insertions, 0 deletions
@@ -1,5 +1,15 @@ 2012-12-19 Andrew John Hughes <gnu_andrew@member.fsf.org> + * 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 <gnu_andrew@member.fsf.org> + * javax/tools/SimpleJavaFileObject.java: New class added. (kind): New field. 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); + } |