Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.compiler/share/classes/javax/lang/model/element/package-info.java
41161 views
1
/*
2
* Copyright (c) 2005, 2020, 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
/**
27
* Interfaces used to model elements of the Java programming language.
28
*
29
* The term "element" in this package is used to refer to program
30
* elements, the declared entities that make up a program. Elements
31
* include classes, interfaces, methods, constructors, and fields.
32
* The interfaces in this package do not model the structure of a
33
* program inside a method body; for example there is no
34
* representation of a {@code for} loop or {@code try}-{@code finally}
35
* block. However, the interfaces can model some structures only
36
* appearing inside method bodies, such as local variables and
37
* anonymous classes.
38
*
39
* <p>When used in the context of annotation processing, an accurate
40
* model of the element being represented must be returned. As this
41
* is a language model, the source code provides the fiducial
42
* (reference) representation of the construct in question rather than
43
* a representation in an executable output like a class file.
44
* Executable output may serve as the basis for creating a modeling
45
* element. However, the process of translating source code to
46
* executable output may not permit recovering some aspects of the
47
* source code representation. For example, annotations with
48
* {@linkplain java.lang.annotation.RetentionPolicy#SOURCE source}
49
* {@linkplain java.lang.annotation.Retention retention} cannot be
50
* recovered from class files and class files might not be able to
51
* provide source position information.
52
*
53
* Names of {@linkplain
54
* javax.lang.model.element.ExecutableElement#getParameters()
55
* parameters} may not be recoverable from class files.
56
*
57
* The {@linkplain javax.lang.model.element.Modifier modifiers} on an
58
* element created from a class file may differ in some cases from an
59
* element for the same declaration created from a source file
60
* including:
61
*
62
* <ul>
63
* <li> {@code strictfp} on a class or interface
64
* <li> {@code final} on a parameter
65
* <li> {@code protected}, {@code private}, and {@code static} on classes and interfaces
66
* </ul>
67
*
68
* Some elements which are {@linkplain
69
* javax.lang.model.util.Elements.Origin#MANDATED mandated} may not be
70
* marked as such when created from class files.
71
*
72
* Additionally, {@linkplain
73
* javax.lang.model.util.Elements.Origin#SYNTHETIC synthetic}
74
* constructs in a class file, such as accessor methods used in
75
* implementing nested classes and {@linkplain
76
* javax.lang.model.util.Elements.Origin#isBridge(ExecutableElement)
77
* bridge methods} used in implementing covariant returns, are
78
* translation artifacts strictly outside of this model. However, when
79
* operating on class files, it is helpful be able to operate on such
80
* elements, screening them out when appropriate.
81
*
82
* <p>During annotation processing, operating on incomplete or
83
* erroneous programs is necessary; however, there are fewer
84
* guarantees about the nature of the resulting model. If the source
85
* code is not syntactically well-formed or has some other
86
* irrecoverable error that could not be removed by the generation of
87
* new classes or interfaces, a model may or may not be provided as a
88
* quality of implementation issue. If a program is syntactically
89
* valid but erroneous in some other fashion, any returned model must
90
* have no less information than if all the method bodies in the
91
* program were replaced by {@code "throw new RuntimeException();"}.
92
* If a program refers to a missing class or interface Xyz, the
93
* returned model must contain no less information than if the
94
* declaration of class or interface Xyz were assumed to be {@code
95
* "class Xyz {}"}, {@code "interface Xyz {}"}, {@code "enum Xyz {}"},
96
* {@code "@interface Xyz {}"}, or {@code "record Xyz {}"}. If a
97
* program refers to a missing class or interface {@code Xyz<K1,
98
* ... ,Kn>}, the returned model must contain no less information than
99
* if the declaration of Xyz were assumed to be {@code "class Xyz<T1,
100
* ... ,Tn> {}"} or {@code "interface Xyz<T1, ... ,Tn> {}"}
101
*
102
* <p> Unless otherwise specified in a particular implementation, the
103
* collections returned by methods in this package should be expected
104
* to be unmodifiable by the caller and unsafe for concurrent access.
105
*
106
* <p> Unless otherwise specified, methods in this package will throw
107
* a {@code NullPointerException} if given a {@code null} argument.
108
*
109
* @author Joseph D. Darcy
110
* @author Scott Seligman
111
* @author Peter von der Ah&eacute;
112
* @see javax.lang.model.util.Elements
113
* @jls 6.1 Declarations
114
* @jls 7.4 Package Declarations
115
* @jls 7.7 Module Declarations
116
* @jls 8.1 Class Declarations
117
* @jls 8.3 Field Declarations
118
* @jls 8.4 Method Declarations
119
* @jls 8.5 Member Class and Interface Declarations
120
* @jls 8.8 Constructor Declarations
121
* @jls 9.1 Interface Declarations
122
* @since 1.6
123
*/
124
package javax.lang.model.element;
125
126