summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2012-12-24 10:09:33 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2012-12-24 10:09:33 +0000
commit621cce7fdf0e325d8789dec762e448844ba0feae (patch)
tree6c5ec32304778620b936672f00ccff99249db79b
parent734a69f1a1ee868a6989d1580bfc1861e015e4c3 (diff)
downloadclasspath-621cce7fdf0e325d8789dec762e448844ba0feae.tar.gz
Add methods to Messager now dependents are in place.
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. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
-rw-r--r--ChangeLog10
-rw-r--r--javax/annotation/processing/Messager.java57
2 files changed, 67 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 86068561f..3f4c463e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);
+
}