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.lang.model;
27
28 import java.util.Collections;
29 import java.util.Set;
30 import java.util.HashSet;
31
32 /**
33 * Source versions of the Java™ programming language.
34 *
35 * See the appropriate edition of
36 * <cite>The Java™ Language Specification</cite>
37 * for information about a particular source version.
38 *
39 * <p>Note that additional source version constants will be added to
40 * model future releases of the language.
41 *
42 * @author Joseph D. Darcy
43 * @author Scott Seligman
44 * @author Peter von der Ahé
45 * @since 1.6
46 */
47 public enum SourceVersion {
48 /*
49 * Summary of language evolution
50 * 1.1: nested classes
51 * 1.2: strictfp
52 * 1.3: no changes
53 * 1.4: assert
54 * 1.5: annotations, generics, autoboxing, var-args...
55 * 1.6: no changes
56 * 1.7: diamond syntax, try-with-resources, etc.
57 * 1.8: lambda expressions and default methods
58 * 9: modules, small cleanups to 1.7 and 1.8 changes
59 * 10: local-variable type inference (var)
60 * 11: local-variable syntax for lambda parameters
61 * 12: no changes (switch expressions in preview)
62 * 13: no changes (switch expressions and text blocks in preview)
63 * 14: switch expressions (pattern matching and records in
64 * preview, text blocks in preview again)
65 * 15: text blocks (records and pattern matching in preview again)
66 */
67
68 /**
69 * The original version.
70 *
71 * The language described in
72 * <cite>The Java™ Language Specification, First Edition</cite>.
73 */
74 RELEASE_0,
75
76 /**
77 * The version recognized by the Java Platform 1.1.
78 *
79 * The language is {@code RELEASE_0} augmented with nested classes as described in the 1.1 update to
80 * <cite>The Java™ Language Specification, First Edition</cite>.
81 */
82 RELEASE_1,
83
84 /**
85 * The version recognized by the Java 2 Platform, Standard Edition,
86 * v 1.2.
87 *
88 * The language described in
89 * <cite>The Java™ Language Specification,
90 * Second Edition</cite>, which includes the {@code
91 * strictfp} modifier.
92 */
93 RELEASE_2,
94
95 /**
96 * The version recognized by the Java 2 Platform, Standard Edition,
97 * v 1.3.
98 *
99 * No major changes from {@code RELEASE_2}.
100 */
101 RELEASE_3,
102
103 /**
104 * The version recognized by the Java 2 Platform, Standard Edition,
105 * v 1.4.
106 *
107 * Added a simple assertion facility.
108 */
109 RELEASE_4,
110
111 /**
112 * The version recognized by the Java 2 Platform, Standard
113 * Edition 5.0.
114 *
115 * The language described in
116 * <cite>The Java™ Language Specification,
117 * Third Edition</cite>. First release to support
118 * generics, annotations, autoboxing, var-args, enhanced {@code
119 * for} loop, and hexadecimal floating-point literals.
120 */
121 RELEASE_5,
122
123 /**
124 * The version recognized by the Java Platform, Standard Edition
125 * 6.
126 *
127 * No major changes from {@code RELEASE_5}.
128 */
129 RELEASE_6,
130
131 /**
132 * The version recognized by the Java Platform, Standard Edition
133 * 7.
134 *
135 * Additions in this release include, diamond syntax for
136 * constructors, {@code try}-with-resources, strings in switch,
|
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.lang.model;
27
28 import java.util.Collections;
29 import java.util.Set;
30 import java.util.HashSet;
31
32 /**
33 * Source versions of the Java programming language.
34 *
35 * See the appropriate edition of
36 * <cite>The Java Language Specification</cite>
37 * for information about a particular source version.
38 *
39 * <p>Note that additional source version constants will be added to
40 * model future releases of the language.
41 *
42 * @author Joseph D. Darcy
43 * @author Scott Seligman
44 * @author Peter von der Ahé
45 * @since 1.6
46 */
47 public enum SourceVersion {
48 /*
49 * Summary of language evolution
50 * 1.1: nested classes
51 * 1.2: strictfp
52 * 1.3: no changes
53 * 1.4: assert
54 * 1.5: annotations, generics, autoboxing, var-args...
55 * 1.6: no changes
56 * 1.7: diamond syntax, try-with-resources, etc.
57 * 1.8: lambda expressions and default methods
58 * 9: modules, small cleanups to 1.7 and 1.8 changes
59 * 10: local-variable type inference (var)
60 * 11: local-variable syntax for lambda parameters
61 * 12: no changes (switch expressions in preview)
62 * 13: no changes (switch expressions and text blocks in preview)
63 * 14: switch expressions (pattern matching and records in
64 * preview, text blocks in preview again)
65 * 15: text blocks (records and pattern matching in preview again)
66 */
67
68 /**
69 * The original version.
70 *
71 * The language described in
72 * <cite>The Java Language Specification, First Edition</cite>.
73 */
74 RELEASE_0,
75
76 /**
77 * The version recognized by the Java Platform 1.1.
78 *
79 * The language is {@code RELEASE_0} augmented with nested classes as described in the 1.1 update to
80 * <cite>The Java Language Specification, First Edition</cite>.
81 */
82 RELEASE_1,
83
84 /**
85 * The version recognized by the Java 2 Platform, Standard Edition,
86 * v 1.2.
87 *
88 * The language described in
89 * <cite>The Java Language Specification,
90 * Second Edition</cite>, which includes the {@code
91 * strictfp} modifier.
92 */
93 RELEASE_2,
94
95 /**
96 * The version recognized by the Java 2 Platform, Standard Edition,
97 * v 1.3.
98 *
99 * No major changes from {@code RELEASE_2}.
100 */
101 RELEASE_3,
102
103 /**
104 * The version recognized by the Java 2 Platform, Standard Edition,
105 * v 1.4.
106 *
107 * Added a simple assertion facility.
108 */
109 RELEASE_4,
110
111 /**
112 * The version recognized by the Java 2 Platform, Standard
113 * Edition 5.0.
114 *
115 * The language described in
116 * <cite>The Java Language Specification,
117 * Third Edition</cite>. First release to support
118 * generics, annotations, autoboxing, var-args, enhanced {@code
119 * for} loop, and hexadecimal floating-point literals.
120 */
121 RELEASE_5,
122
123 /**
124 * The version recognized by the Java Platform, Standard Edition
125 * 6.
126 *
127 * No major changes from {@code RELEASE_5}.
128 */
129 RELEASE_6,
130
131 /**
132 * The version recognized by the Java Platform, Standard Edition
133 * 7.
134 *
135 * Additions in this release include, diamond syntax for
136 * constructors, {@code try}-with-resources, strings in switch,
|