Note that additional source version constants will be added to model future releases of the language.
java.lang.reflect.ClassFileFormatVersion
| Modifier and Type | Field and Description |
|---|---|
| private static final SourceVersion | |
| public static final SourceVersion | RELEASE_0
The original version. |
| public static final SourceVersion | RELEASE_1
The version introduced by the Java Platform 1.1. |
| public static final SourceVersion | RELEASE_10
The version introduced by the Java Platform, Standard Edition 10. |
| public static final SourceVersion | RELEASE_11
The version introduced by the Java Platform, Standard Edition 11. |
| public static final SourceVersion | RELEASE_12
The version introduced by the Java Platform, Standard Edition 12. |
| public static final SourceVersion | RELEASE_13
The version introduced by the Java Platform, Standard Edition 13. |
| public static final SourceVersion | RELEASE_14
The version introduced by the Java Platform, Standard Edition 14. |
| public static final SourceVersion | RELEASE_15
The version introduced by the Java Platform, Standard Edition 15. |
| public static final SourceVersion | RELEASE_16
The version introduced by the Java Platform, Standard Edition 16. |
| public static final SourceVersion | RELEASE_17
The version introduced by the Java Platform, Standard Edition 17. |
| public static final SourceVersion | RELEASE_18
The version introduced by the Java Platform, Standard Edition 18. |
| public static final SourceVersion | RELEASE_19
The version introduced by the Java Platform, Standard Edition 19. |
| public static final SourceVersion | RELEASE_2
The version introduced by the Java 2 Platform, Standard Edition, v 1.2. |
| public static final SourceVersion | RELEASE_20
The version introduced by the Java Platform, Standard Edition 20. |
| public static final SourceVersion | RELEASE_21
The version introduced by the Java Platform, Standard Edition 21. |
| public static final SourceVersion | RELEASE_22
The version introduced by the Java Platform, Standard Edition 22. |
| public static final SourceVersion | RELEASE_23
The version introduced by the Java Platform, Standard Edition 23. |
| public static final SourceVersion | RELEASE_24
The version introduced by the Java Platform, Standard Edition 24. |
| public static final SourceVersion | RELEASE_25
The version introduced by the Java Platform, Standard Edition 25. |
| public static final SourceVersion | RELEASE_26
The version introduced by the Java Platform, Standard Edition 26. |
| public static final SourceVersion | RELEASE_27
The version introduced by the Java Platform, Standard Edition 27. |
| public static final SourceVersion | RELEASE_3
The version introduced by the Java 2 Platform, Standard Edition, v 1.3. |
| public static final SourceVersion | RELEASE_4
The version introduced by the Java 2 Platform, Standard Edition, v 1.4. |
| public static final SourceVersion | RELEASE_5
The version introduced by the Java 2 Platform, Standard Edition 5.0. |
| public static final SourceVersion | RELEASE_6
The version introduced by the Java Platform, Standard Edition 6. |
| public static final SourceVersion | RELEASE_7
The version introduced by the Java Platform, Standard Edition 7. |
| public static final SourceVersion | RELEASE_8
The version introduced by the Java Platform, Standard Edition 8. |
| public static final SourceVersion | RELEASE_9
The version introduced by the Java Platform, Standard Edition 9. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static SourceVersion | |
| public static boolean | Returns: true if this string is a
syntactically valid identifier or keyword, false
otherwise.the string to check name)Returns whether or not |
| public static boolean | Returns: true if s is a keyword, a boolean
literal, or the null literal, false otherwise.the string to check s)Returns whether or not |
| public static boolean | Returns: true if s is a keyword, a boolean
literal, or the null literal, false otherwise.the string to check s, SourceVersion the version to use version)Returns whether or not |
| public static boolean | Returns: true if this string is a
syntactically valid name, false otherwise.the string to check name)Returns whether or not |
| public static boolean | Returns: true if this string is a
syntactically valid name, false otherwise.the string to check name, SourceVersion the version to use version)Returns whether or not |
| public static SourceVersion | Returns: the latest source version that can be modeledReturns the latest source version that can be modeled. |
| public static SourceVersion | Returns: the latest source version fully supported by the current execution environmentReturns the latest source version fully supported by the current execution environment. |
| public Runtime. | Returns: the least runtime version that supports this source version; otherwisenullReturns the least runtime version that supports this source
version; otherwise |
| public static SourceVersion | |
| public static SourceVersion | |
| public static SourceVersion[] |
| latestSupported | back to summary |
|---|---|
| private static final SourceVersion latestSupported | |
| RELEASE_0 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_0 The original version. The language described in The Java Language Specification, First Edition. | |
| RELEASE_1 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_1 The version introduced by the Java Platform 1.1.
The language is | |
| RELEASE_10 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_10 The version introduced by the Java Platform, Standard Edition
10.
Additions in this release include local-variable type inference
( | |
| RELEASE_11 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_11 The version introduced by the Java Platform, Standard Edition 11. Additions in this release include local-variable syntax for lambda parameters. | |
| RELEASE_12 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_12 The version introduced by the Java Platform, Standard Edition 12. No major changes from the prior release.
| |
| RELEASE_13 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_13 The version introduced by the Java Platform, Standard Edition 13. No major changes from the prior release.
| |
| RELEASE_14 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_14 The version introduced by the Java Platform, Standard Edition 14. Additions in this release include switch expressions.
| |
| RELEASE_15 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_15 The version introduced by the Java Platform, Standard Edition 15. Additions in this release include text blocks.
| |
| RELEASE_16 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_16 The version introduced by the Java Platform, Standard Edition
16.
Additions in this release include records and pattern matching
for | |
| RELEASE_17 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_17 The version introduced by the Java Platform, Standard Edition 17. Additions in this release include sealed classes and restoration of always-strict floating-point semantics. | |
| RELEASE_18 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_18 The version introduced by the Java Platform, Standard Edition 18. No major changes from the prior release.
| |
| RELEASE_19 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_19 The version introduced by the Java Platform, Standard Edition 19. No major changes from the prior release.
| |
| RELEASE_2 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_2 The version introduced by the Java 2 Platform, Standard Edition,
v 1.2.
The language described in
The Java Language Specification,
Second Edition, which includes the | |
| RELEASE_20 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_20 The version introduced by the Java Platform, Standard Edition 20. No major changes from the prior release.
| |
| RELEASE_21 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_21 The version introduced by the Java Platform, Standard Edition
21.
Additions in this release include record patterns and pattern
matching for | |
| RELEASE_22 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_22 The version introduced by the Java Platform, Standard Edition 22. Additions in this release include unnamed variables and unnamed patterns. | |
| RELEASE_23 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_23 The version introduced by the Java Platform, Standard Edition 23.
| |
| RELEASE_24 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_24 The version introduced by the Java Platform, Standard Edition 24.
| |
| RELEASE_25 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_25 The version introduced by the Java Platform, Standard Edition 25. Additions in this release include module import declarations, compact source files and instance main methods, and flexible constructor bodies. | |
| RELEASE_26 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_26 The version introduced by the Java Platform, Standard Edition 26.
| |
| RELEASE_27 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_27 The version introduced by the Java Platform, Standard Edition 27.
| |
| RELEASE_3 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_3 The version introduced by the Java 2 Platform, Standard Edition,
v 1.3.
No major changes from | |
| RELEASE_4 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_4 The version introduced by the Java 2 Platform, Standard Edition, v 1.4. Added a simple assertion facility.
| |
| RELEASE_5 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_5 The version introduced by the Java 2 Platform, Standard
Edition 5.0.
The language described in
The Java Language Specification,
Third Edition. First release to support
generics, annotations, autoboxing, var-args, enhanced | |
| RELEASE_6 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_6 The version introduced by the Java Platform, Standard Edition
6.
No major changes from | |
| RELEASE_7 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_7 The version introduced by the Java Platform, Standard Edition
7.
Additions in this release include diamond syntax for
constructors, | |
| RELEASE_8 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_8 The version introduced by the Java Platform, Standard Edition 8. Additions in this release include lambda expressions and default methods. | |
| RELEASE_9 | back to summary |
|---|---|
| public static final SourceVersion RELEASE_9 The version introduced by the Java Platform, Standard Edition 9. Additions in this release include modules and removal of a single underscore from the set of legal identifier names. | |
| SourceVersion | back to summary |
|---|---|
| private SourceVersion() | |
| getLatestSupported | back to summary |
|---|---|
| private static SourceVersion getLatestSupported() | |
| isIdentifier | back to summary |
|---|---|
| public static boolean isIdentifier(CharSequence name) Returns whether or not
| |
| isKeyword | back to summary |
|---|---|
| public static boolean isKeyword(CharSequence s) Returns whether or not
| |
| isKeyword | back to summary |
|---|---|
| public static boolean isKeyword(CharSequence s, SourceVersion version) Returns whether or not
| |
| isName | back to summary |
|---|---|
| public static boolean isName(CharSequence name) Returns whether or not
| |
| isName | back to summary |
|---|---|
| public static boolean isName(CharSequence name, SourceVersion version) Returns whether or not
| |
| latest | back to summary |
|---|---|
| public static SourceVersion latest() Returns the latest source version that can be modeled.
| |
| latestSupported | back to summary |
|---|---|
| public static SourceVersion latestSupported() Returns the latest source version fully supported by the
current execution environment. API Note This method is included alongside
| |
| runtimeVersion | back to summary |
|---|---|
| public Runtime. Returns the least runtime version that supports this source
version; otherwise | |
| valueOf | back to summary |
|---|---|
| public static SourceVersion valueOf(String name) | |
| valueOf | back to summary |
|---|---|
| public static SourceVersion valueOf(Runtime. Returns the latest source version that is usable under the
runtime version argument. If the runtime version's feature is greater than the feature
of the runtime version of the
latest source version, an Because the source versions of the Java programming language have so far followed a linear progression, only the feature component of a runtime version is queried to determine the mapping to a source version. If that linearity changes in the future, other components of the runtime version may influence the result. API Note An expression to convert from a string value, for example
SourceVersion.valueOf(Runtime.Version.parse("17"))
| |
| values | back to summary |
|---|---|
| public static SourceVersion[] values() | |