author | darcy |
Mon, 23 Jan 2017 10:37:27 -0800 | |
changeset 43280 | 692b0dfbb390 |
parent 42825 | c22877f68145 |
child 43369 | aafd33c96bac |
permissions | -rw-r--r-- |
10 | 1 |
/* |
37848
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
2 |
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 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 |
* |
|
5520 | 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. |
|
10 | 24 |
*/ |
25 |
||
26 |
package javax.lang.model.util; |
|
27 |
||
28 |
||
29 |
import java.util.List; |
|
30 |
import java.util.Map; |
|
31 |
||
42825
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
32 |
import javax.lang.model.AnnotatedConstruct; |
10 | 33 |
import javax.lang.model.element.*; |
34 |
||
35 |
||
36 |
/** |
|
37 |
* Utility methods for operating on program elements. |
|
38 |
* |
|
39 |
* <p><b>Compatibility Note:</b> Methods may be added to this interface |
|
40 |
* in future releases of the platform. |
|
41 |
* |
|
42 |
* @author Joseph D. Darcy |
|
43 |
* @author Scott Seligman |
|
44 |
* @author Peter von der Ahé |
|
45 |
* @see javax.annotation.processing.ProcessingEnvironment#getElementUtils |
|
46 |
* @since 1.6 |
|
47 |
*/ |
|
48 |
public interface Elements { |
|
49 |
||
50 |
/** |
|
42824 | 51 |
* Returns a package given its fully qualified name if the package is unique in the environment. |
52 |
* If running with modules, all modules in the modules graph are searched for matching packages. |
|
10 | 53 |
* |
37848
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
54 |
* @param name fully qualified package name, or an empty string for an unnamed package |
42824 | 55 |
* @return the named package, or {@code null} if it cannot be uniquely found |
10 | 56 |
*/ |
57 |
PackageElement getPackageElement(CharSequence name); |
|
58 |
||
59 |
/** |
|
37848
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
60 |
* Returns a package given its fully qualified name, as seen from the given module. |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
61 |
* |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
62 |
* @param name fully qualified package name, or an empty string for an unnamed package |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
63 |
* @param module module relative to which the lookup should happen |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
64 |
* @return the named package, or {@code null} if it cannot be found |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
65 |
* @since 9 |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
66 |
*/ |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
67 |
PackageElement getPackageElement(ModuleElement module, CharSequence name); |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
68 |
|
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
69 |
/** |
42824 | 70 |
* Returns a type element given its canonical name if the type element is unique in the environment. |
71 |
* If running with modules, all modules in the modules graph are searched for matching |
|
72 |
* type elements. |
|
10 | 73 |
* |
74 |
* @param name the canonical name |
|
42824 | 75 |
* @return the named type element, or {@code null} if it cannot be uniquely found |
10 | 76 |
*/ |
77 |
TypeElement getTypeElement(CharSequence name); |
|
78 |
||
79 |
/** |
|
37848
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
80 |
* Returns a type element given its canonical name, as seen from the given module. |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
81 |
* |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
82 |
* @param name the canonical name |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
83 |
* @param module module relative to which the lookup should happen |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
84 |
* @return the named type element, or {@code null} if it cannot be found |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
85 |
* @since 9 |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
86 |
*/ |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
87 |
TypeElement getTypeElement(ModuleElement module, CharSequence name); |
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
88 |
|
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
89 |
/** |
36526 | 90 |
* Returns a module element given its fully qualified name. |
42824 | 91 |
* If the named module cannot be found, null is returned. One situation where a module |
92 |
* cannot be found is if the environment does not include modules, such as |
|
93 |
* an annotation processing environment configured for |
|
43280
692b0dfbb390
8173164: Resolve remaining HTML5 issues in javax.lang.model.*
darcy
parents:
42825
diff
changeset
|
94 |
* a {@linkplain |
692b0dfbb390
8173164: Resolve remaining HTML5 issues in javax.lang.model.*
darcy
parents:
42825
diff
changeset
|
95 |
* javax.annotation.processing.ProcessingEnvironment#getSourceVersion |
692b0dfbb390
8173164: Resolve remaining HTML5 issues in javax.lang.model.*
darcy
parents:
42825
diff
changeset
|
96 |
* source version} without modules. |
36526 | 97 |
* |
98 |
* @param name the name |
|
99 |
* @return the named module element, or {@code null} if it cannot be found |
|
100 |
* @since 9 |
|
101 |
*/ |
|
102 |
ModuleElement getModuleElement(CharSequence name); |
|
103 |
||
104 |
/** |
|
10 | 105 |
* Returns the values of an annotation's elements, including defaults. |
106 |
* |
|
107 |
* @see AnnotationMirror#getElementValues() |
|
108 |
* @param a annotation to examine |
|
109 |
* @return the values of the annotation's elements, including defaults |
|
110 |
*/ |
|
111 |
Map<? extends ExecutableElement, ? extends AnnotationValue> |
|
112 |
getElementValuesWithDefaults(AnnotationMirror a); |
|
113 |
||
114 |
/** |
|
115 |
* Returns the text of the documentation ("Javadoc") |
|
116 |
* comment of an element. |
|
117 |
* |
|
4074
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
118 |
* <p> A documentation comment of an element is a comment that |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
119 |
* begins with "{@code /**}" , ends with a separate |
13844 | 120 |
* "<code>*/</code>", and immediately precedes the element, |
4074
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
121 |
* ignoring white space. Therefore, a documentation comment |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
122 |
* contains at least three"{@code *}" characters. The text |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
123 |
* returned for the documentation comment is a processed form of |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
124 |
* the comment as it appears in source code. The leading "{@code |
13844 | 125 |
* /**}" and trailing "<code>*/</code>" are removed. For lines |
4074
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
126 |
* of the comment starting after the initial "{@code /**}", |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
127 |
* leading white space characters are discarded as are any |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
128 |
* consecutive "{@code *}" characters appearing after the white |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
129 |
* space or starting the line. The processed lines are then |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
130 |
* concatenated together (including line terminators) and |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
131 |
* returned. |
2b391dcb03ff
6558804: Specification for Elements.getDocComment(Element e) should be clarified
darcy
parents:
10
diff
changeset
|
132 |
* |
10 | 133 |
* @param e the element being examined |
134 |
* @return the documentation comment of the element, or {@code null} |
|
135 |
* if there is none |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
136 |
* @jls 3.6 White Space |
10 | 137 |
*/ |
138 |
String getDocComment(Element e); |
|
139 |
||
140 |
/** |
|
141 |
* Returns {@code true} if the element is deprecated, {@code false} otherwise. |
|
142 |
* |
|
143 |
* @param e the element being examined |
|
144 |
* @return {@code true} if the element is deprecated, {@code false} otherwise |
|
145 |
*/ |
|
146 |
boolean isDeprecated(Element e); |
|
147 |
||
148 |
/** |
|
42825
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
149 |
* Returns the <em>origin</em> of the given element. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
150 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
151 |
* <p>Note that if this method returns {@link Origin#EXPLICIT |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
152 |
* EXPLICIT} and the element was created from a class file, then |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
153 |
* the element may not, in fact, correspond to an explicitly |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
154 |
* declared construct in source code. This is due to limitations |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
155 |
* of the fidelity of the class file format in preserving |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
156 |
* information from source code. For example, at least some |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
157 |
* versions of the class file format do not preserve whether a |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
158 |
* constructor was explicitly declared by the programmer or was |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
159 |
* implicitly declared as the <em>default constructor</em>. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
160 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
161 |
* @implSpec The default implementation of this method returns |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
162 |
* {@link Origin#EXPLICIT EXPLICIT}. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
163 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
164 |
* @param e the element being examined |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
165 |
* @return the origin of the given element |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
166 |
* @since 9 |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
167 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
168 |
default Origin getOrigin(Element e) { |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
169 |
return Origin.EXPLICIT; |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
170 |
} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
171 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
172 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
173 |
* Returns the <em>origin</em> of the given annotation mirror. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
174 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
175 |
* An annotation mirror is {@linkplain Origin#MANDATED mandated} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
176 |
* if it is an implicitly declared <em>container annotation</em> |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
177 |
* used to hold repeated annotations of a repeatable annotation |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
178 |
* type. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
179 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
180 |
* <p>Note that if this method returns {@link Origin#EXPLICIT |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
181 |
* EXPLICIT} and the annotation mirror was created from a class |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
182 |
* file, then the element may not, in fact, correspond to an |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
183 |
* explicitly declared construct in source code. This is due to |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
184 |
* limitations of the fidelity of the class file format in |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
185 |
* preserving information from source code. For example, at least |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
186 |
* some versions of the class file format do not preserve whether |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
187 |
* an annotation was explicitly declared by the programmer or was |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
188 |
* implicitly declared as a <em>container annotation</em>. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
189 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
190 |
* @implSpec The default implementation of this method returns |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
191 |
* {@link Origin#EXPLICIT EXPLICIT}. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
192 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
193 |
* @param c the construct the annotation mirror modifies |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
194 |
* @param a the annotation mirror being examined |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
195 |
* @return the origin of the given annotation mirror |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
196 |
* @jls 9.6.3 Repeatable Annotation Types |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
197 |
* @jls 9.7.5 Multiple Annotations of the Same Type |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
198 |
* @since 9 |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
199 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
200 |
default Origin getOrigin(AnnotatedConstruct c, |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
201 |
AnnotationMirror a) { |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
202 |
return Origin.EXPLICIT; |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
203 |
} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
204 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
205 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
206 |
* Returns the <em>origin</em> of the given module directive. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
207 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
208 |
* <p>Note that if this method returns {@link Origin#EXPLICIT |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
209 |
* EXPLICIT} and the module directive was created from a class |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
210 |
* file, then the module directive may not, in fact, correspond to |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
211 |
* an explicitly declared construct in source code. This is due to |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
212 |
* limitations of the fidelity of the class file format in |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
213 |
* preserving information from source code. For example, at least |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
214 |
* some versions of the class file format do not preserve whether |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
215 |
* a {@code uses} directive was explicitly declared by the |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
216 |
* programmer or was added as a synthetic construct. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
217 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
218 |
* <p>Note that an implementation may not be able to reliably |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
219 |
* determine the origin status of the directive if the directive |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
220 |
* is created from a class file due to limitations of the fidelity |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
221 |
* of the class file format in preserving information from source |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
222 |
* code. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
223 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
224 |
* @implSpec The default implementation of this method returns |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
225 |
* {@link Origin#EXPLICIT EXPLICIT}. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
226 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
227 |
* @param m the module of the directive |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
228 |
* @param directive the module directive being examined |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
229 |
* @return the origin of the given directive |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
230 |
* @since 9 |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
231 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
232 |
default Origin getOrigin(ModuleElement m, |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
233 |
ModuleElement.Directive directive) { |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
234 |
return Origin.EXPLICIT; |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
235 |
} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
236 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
237 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
238 |
* The <em>origin</em> of an element or other language model |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
239 |
* item. The origin of an element or item models how a construct |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
240 |
* in a program is declared in the source code, explicitly, |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
241 |
* implicitly, etc. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
242 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
243 |
* <p>Note that it is possible additional kinds of origin values |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
244 |
* will be added in future versions of the platform. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
245 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
246 |
* @jls 13.1 The Form of a Binary |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
247 |
* @since 9 |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
248 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
249 |
public enum Origin { |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
250 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
251 |
* Describes a construct explicitly declared in source code. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
252 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
253 |
EXPLICIT, |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
254 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
255 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
256 |
* A mandated construct is one that is not explicitly declared |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
257 |
* in the source code, but whose presence is mandated by the |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
258 |
* specification. Such a construct is said to be implicitly |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
259 |
* declared. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
260 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
261 |
* One example of a mandated element is a <em>default |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
262 |
* constructor</em> in a class that contains no explicit |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
263 |
* constructor declarations. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
264 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
265 |
* Another example of a mandated construct is an implicitly |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
266 |
* declared <em>container annotation</em> used to hold |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
267 |
* multiple annotations of a repeatable annotation type. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
268 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
269 |
* @jls 8.8.9 Default Constructor |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
270 |
* @jls 9.6.3 Repeatable Annotation Types |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
271 |
* @jls 9.7.5 Multiple Annotations of the Same Type |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
272 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
273 |
MANDATED, |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
274 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
275 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
276 |
* A synthetic construct is one that is neither implicitly nor |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
277 |
* explicitly declared in the source code. Such a construct is |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
278 |
* typically a translation artifact created by a compiler. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
279 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
280 |
SYNTHETIC; |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
281 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
282 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
283 |
* Returns {@code true} for values corresponding to constructs |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
284 |
* that are implicitly or explicitly declared, {@code false} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
285 |
* otherwise. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
286 |
* @return {@code true} for {@link EXPLICIT} and {@link |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
287 |
* MANDATED}, {@code false} otherwise. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
288 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
289 |
public boolean isDeclared() { |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
290 |
return this != SYNTHETIC; |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
291 |
} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
292 |
} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
293 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
294 |
/** |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
295 |
* Returns {@code true} if the executable element is a bridge |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
296 |
* method, {@code false} otherwise. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
297 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
298 |
* @implSpec The default implementation of this method returns {@code false}. |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
299 |
* |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
300 |
* @param e the executable being examined |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
301 |
* @return {@code true} if the executable element is a bridge |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
302 |
* method, {@code false} otherwise |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
303 |
* @since 9 |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
304 |
*/ |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
305 |
default boolean isBridge(ExecutableElement e) { |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
306 |
return false; |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
307 |
} |
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
308 |
|
c22877f68145
8163315: Implement an API to identify an implicitly declared annotation (or declaration)
darcy
parents:
42824
diff
changeset
|
309 |
/** |
10 | 310 |
* Returns the <i>binary name</i> of a type element. |
311 |
* |
|
312 |
* @param type the type element being examined |
|
313 |
* @return the binary name |
|
314 |
* |
|
315 |
* @see TypeElement#getQualifiedName |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
316 |
* @jls 13.1 The Form of a Binary |
10 | 317 |
*/ |
318 |
Name getBinaryName(TypeElement type); |
|
319 |
||
320 |
||
321 |
/** |
|
322 |
* Returns the package of an element. The package of a package is |
|
323 |
* itself. |
|
324 |
* |
|
325 |
* @param type the element being examined |
|
326 |
* @return the package of an element |
|
327 |
*/ |
|
328 |
PackageElement getPackageOf(Element type); |
|
329 |
||
330 |
/** |
|
36526 | 331 |
* Returns the module of an element. The module of a module is |
332 |
* itself. |
|
42824 | 333 |
* If there is no module for the element, null is returned. One situation where there is |
334 |
* no module for an element is if the environment does not include modules, such as |
|
335 |
* an annotation processing environment configured for |
|
43280
692b0dfbb390
8173164: Resolve remaining HTML5 issues in javax.lang.model.*
darcy
parents:
42825
diff
changeset
|
336 |
* a {@linkplain |
692b0dfbb390
8173164: Resolve remaining HTML5 issues in javax.lang.model.*
darcy
parents:
42825
diff
changeset
|
337 |
* javax.annotation.processing.ProcessingEnvironment#getSourceVersion |
692b0dfbb390
8173164: Resolve remaining HTML5 issues in javax.lang.model.*
darcy
parents:
42825
diff
changeset
|
338 |
* source version} without modules. |
36526 | 339 |
* |
340 |
* @param type the element being examined |
|
341 |
* @return the module of an element |
|
342 |
* @since 9 |
|
343 |
*/ |
|
344 |
ModuleElement getModuleOf(Element type); |
|
345 |
||
346 |
/** |
|
10 | 347 |
* Returns all members of a type element, whether inherited or |
348 |
* declared directly. For a class the result also includes its |
|
349 |
* constructors, but not local or anonymous classes. |
|
350 |
* |
|
351 |
* <p>Note that elements of certain kinds can be isolated using |
|
352 |
* methods in {@link ElementFilter}. |
|
353 |
* |
|
354 |
* @param type the type being examined |
|
355 |
* @return all members of the type |
|
356 |
* @see Element#getEnclosedElements |
|
357 |
*/ |
|
358 |
List<? extends Element> getAllMembers(TypeElement type); |
|
359 |
||
360 |
/** |
|
17802
83c53847fc7e
8010680: Clarify "present" and annotation ordering in javax.lang.model
darcy
parents:
17548
diff
changeset
|
361 |
* Returns all annotations <i>present</i> on an element, whether |
83c53847fc7e
8010680: Clarify "present" and annotation ordering in javax.lang.model
darcy
parents:
17548
diff
changeset
|
362 |
* directly present or present via inheritance. |
10 | 363 |
* |
364 |
* @param e the element being examined |
|
365 |
* @return all annotations of the element |
|
366 |
* @see Element#getAnnotationMirrors |
|
17802
83c53847fc7e
8010680: Clarify "present" and annotation ordering in javax.lang.model
darcy
parents:
17548
diff
changeset
|
367 |
* @see javax.lang.model.AnnotatedConstruct |
10 | 368 |
*/ |
369 |
List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e); |
|
370 |
||
371 |
/** |
|
372 |
* Tests whether one type, method, or field hides another. |
|
373 |
* |
|
374 |
* @param hider the first element |
|
375 |
* @param hidden the second element |
|
376 |
* @return {@code true} if and only if the first element hides |
|
377 |
* the second |
|
378 |
*/ |
|
379 |
boolean hides(Element hider, Element hidden); |
|
380 |
||
381 |
/** |
|
382 |
* Tests whether one method, as a member of a given type, |
|
383 |
* overrides another method. |
|
384 |
* When a non-abstract method overrides an abstract one, the |
|
385 |
* former is also said to <i>implement</i> the latter. |
|
386 |
* |
|
387 |
* <p> In the simplest and most typical usage, the value of the |
|
388 |
* {@code type} parameter will simply be the class or interface |
|
389 |
* directly enclosing {@code overrider} (the possibly-overriding |
|
390 |
* method). For example, suppose {@code m1} represents the method |
|
391 |
* {@code String.hashCode} and {@code m2} represents {@code |
|
392 |
* Object.hashCode}. We can then ask whether {@code m1} overrides |
|
393 |
* {@code m2} within the class {@code String} (it does): |
|
394 |
* |
|
395 |
* <blockquote> |
|
396 |
* {@code assert elements.overrides(m1, m2, |
|
397 |
* elements.getTypeElement("java.lang.String")); } |
|
398 |
* </blockquote> |
|
399 |
* |
|
400 |
* A more interesting case can be illustrated by the following example |
|
401 |
* in which a method in type {@code A} does not override a |
|
402 |
* like-named method in type {@code B}: |
|
403 |
* |
|
404 |
* <blockquote> |
|
405 |
* {@code class A { public void m() {} } }<br> |
|
406 |
* {@code interface B { void m(); } }<br> |
|
407 |
* ...<br> |
|
408 |
* {@code m1 = ...; // A.m }<br> |
|
409 |
* {@code m2 = ...; // B.m }<br> |
|
410 |
* {@code assert ! elements.overrides(m1, m2, |
|
411 |
* elements.getTypeElement("A")); } |
|
412 |
* </blockquote> |
|
413 |
* |
|
414 |
* When viewed as a member of a third type {@code C}, however, |
|
415 |
* the method in {@code A} does override the one in {@code B}: |
|
416 |
* |
|
417 |
* <blockquote> |
|
418 |
* {@code class C extends A implements B {} }<br> |
|
419 |
* ...<br> |
|
420 |
* {@code assert elements.overrides(m1, m2, |
|
421 |
* elements.getTypeElement("C")); } |
|
422 |
* </blockquote> |
|
423 |
* |
|
424 |
* @param overrider the first method, possible overrider |
|
425 |
* @param overridden the second method, possibly being overridden |
|
426 |
* @param type the type of which the first method is a member |
|
427 |
* @return {@code true} if and only if the first method overrides |
|
428 |
* the second |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
429 |
* @jls 8.4.8 Inheritance, Overriding, and Hiding |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
430 |
* @jls 9.4.1 Inheritance and Overriding |
10 | 431 |
*/ |
432 |
boolean overrides(ExecutableElement overrider, ExecutableElement overridden, |
|
433 |
TypeElement type); |
|
434 |
||
435 |
/** |
|
436 |
* Returns the text of a <i>constant expression</i> representing a |
|
437 |
* primitive value or a string. |
|
438 |
* The text returned is in a form suitable for representing the value |
|
439 |
* in source code. |
|
440 |
* |
|
441 |
* @param value a primitive value or string |
|
442 |
* @return the text of a constant expression |
|
443 |
* @throws IllegalArgumentException if the argument is not a primitive |
|
444 |
* value or string |
|
445 |
* |
|
446 |
* @see VariableElement#getConstantValue() |
|
447 |
*/ |
|
448 |
String getConstantExpression(Object value); |
|
449 |
||
450 |
/** |
|
451 |
* Prints a representation of the elements to the given writer in |
|
452 |
* the specified order. The main purpose of this method is for |
|
453 |
* diagnostics. The exact format of the output is <em>not</em> |
|
454 |
* specified and is subject to change. |
|
455 |
* |
|
456 |
* @param w the writer to print the output to |
|
457 |
* @param elements the elements to print |
|
458 |
*/ |
|
459 |
void printElements(java.io.Writer w, Element... elements); |
|
460 |
||
461 |
/** |
|
462 |
* Return a name with the same sequence of characters as the |
|
463 |
* argument. |
|
464 |
* |
|
465 |
* @param cs the character sequence to return as a name |
|
17548 | 466 |
* @return a name with the same sequence of characters as the argument |
10 | 467 |
*/ |
468 |
Name getName(CharSequence cs); |
|
15714
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
469 |
|
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
470 |
/** |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
471 |
* Returns {@code true} if the type element is a functional interface, {@code false} otherwise. |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
472 |
* |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
473 |
* @param type the type element being examined |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
474 |
* @return {@code true} if the element is a functional interface, {@code false} otherwise |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
475 |
* @jls 9.8 Functional Interfaces |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
476 |
* @since 1.8 |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
477 |
*/ |
d9a83ab62853
8007574: Provide isFunctionalInterface in javax.lang.model
darcy
parents:
13844
diff
changeset
|
478 |
boolean isFunctionalInterface(TypeElement type); |
10 | 479 |
} |