Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.compiler/share/classes/javax/annotation/processing/Messager.java
41159 views
1
/*
2
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package javax.annotation.processing;
27
28
import javax.tools.Diagnostic;
29
import javax.lang.model.element.*;
30
31
/**
32
* A {@code Messager} provides the way for an annotation processor to
33
* report error messages, warnings, and other notices. Elements,
34
* annotations, and annotation values can be passed to provide a
35
* location hint for the message. However, such location hints may be
36
* unavailable or only approximate.
37
*
38
* <p>Printing a message with an {@linkplain
39
* javax.tools.Diagnostic.Kind#ERROR error kind} will {@linkplain
40
* RoundEnvironment#errorRaised raise an error}.
41
*
42
* <p>Note that the messages &quot;printed&quot; by methods in this
43
* interface may or may not appear as textual output to a location
44
* like {@link System#out} or {@link System#err}. Implementations may
45
* choose to present this information in a different fashion, such as
46
* messages in a window.
47
*
48
* @author Joseph D. Darcy
49
* @author Scott Seligman
50
* @author Peter von der Ah&eacute;
51
* @see ProcessingEnvironment#getLocale
52
* @since 1.6
53
*/
54
public interface Messager {
55
/**
56
* Prints a message of the specified kind.
57
*
58
* @param kind the kind of message
59
* @param msg the message, or an empty string if none
60
*/
61
void printMessage(Diagnostic.Kind kind, CharSequence msg);
62
63
/**
64
* Prints a message of the specified kind at the location of the
65
* element.
66
*
67
* @param kind the kind of message
68
* @param msg the message, or an empty string if none
69
* @param e the element to use as a position hint
70
*/
71
void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e);
72
73
/**
74
* Prints a message of the specified kind at the location of the
75
* annotation mirror of the annotated element.
76
*
77
* @param kind the kind of message
78
* @param msg the message, or an empty string if none
79
* @param e the annotated element
80
* @param a the annotation to use as a position hint
81
*/
82
void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a);
83
84
/**
85
* Prints a message of the specified kind at the location of the
86
* annotation value inside the annotation mirror of the annotated
87
* element.
88
*
89
* @param kind the kind of message
90
* @param msg the message, or an empty string if none
91
* @param e the annotated element
92
* @param a the annotation containing the annotation value
93
* @param v the annotation value to use as a position hint
94
*/
95
void printMessage(Diagnostic.Kind kind,
96
CharSequence msg,
97
Element e,
98
AnnotationMirror a,
99
AnnotationValue v);
100
}
101
102