-
public interface MessagerAMessager为注释处理器提供报告错误消息,警告和其他通知的方式。 可以传递元素,注释和注释值以提供消息的位置提示。 但是,这样的位置提示可能不可用或只是近似。打印邮件error kind将raise an error 。
请注意,通过此界面中的方法“打印”的消息可能显示为也可能不会显示为像
System.out或System.err这样的位置的文本输出。 实现可以选择以不同的方式呈现这些信息,例如窗口中的消息。- 从以下版本开始:
- 1.6
- 另请参见:
-
ProcessingEnvironment.getLocale()
-
-
方法摘要
所有方法 接口方法 抽象方法 Modifier and Type 方法 描述 voidprintMessage(Diagnostic.Kind kind, CharSequence msg)打印指定类型的消息。voidprintMessage(Diagnostic.Kind kind, CharSequence msg, Element e)在元素的位置打印指定类型的消息。voidprintMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a)在注释元素的注释镜像的位置打印指定类型的消息。voidprintMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a, AnnotationValue v)在注释元素的注释镜像内的注释值的位置打印指定类型的消息。
-
-
-
方法详细信息
-
printMessage
void printMessage(Diagnostic.Kind kind, CharSequence msg)
打印指定类型的消息。- 参数
-
kind- 那种消息 -
msg- 消息,或空字符串(如果没有)
-
printMessage
void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e)
在元素的位置打印指定类型的消息。- 参数
-
kind- 那种消息 -
msg- 消息,或空字符串(如果没有) -
e- 用作位置提示的元素
-
printMessage
void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a)
在注释元素的注释镜像的位置打印指定类型的消息。- 参数
-
kind- 消息的种类 -
msg- 消息,或空字符串(如果没有) -
e- 注释元素 -
a- 用作位置提示的注释
-
printMessage
void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a, AnnotationValue v)
在注释元素的注释镜像内的注释值的位置打印指定类型的消息。- 参数
-
kind- 那种消息 -
msg- 消息,或空字符串(如果没有) -
e- 注释元素 -
a- 包含注释值的注释 -
v- the annotation value to use as a position hint
-
-