Enum Class SourceVersion
- All Implemented Interfaces:
Serializable
,Comparable<SourceVersion>
,Constable
Source versions of the Java programming language.
See the appropriate edition of
The Java Language Specification
for information about a particular source version.
Note that additional source version constants will be added to model future releases of the language.
- Since:
- 1.6
- See Also:
-
Nested Class Summary
Nested classes/interfaces declared in class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe original version.The version introduced by the Java Platform 1.1.The version introduced by the Java Platform, Standard Edition 10.The version introduced by the Java Platform, Standard Edition 11.The version introduced by the Java Platform, Standard Edition 12.The version introduced by the Java Platform, Standard Edition 13.The version introduced by the Java Platform, Standard Edition 14.The version introduced by the Java Platform, Standard Edition 15.The version introduced by the Java Platform, Standard Edition 16.The version introduced by the Java Platform, Standard Edition 17.The version introduced by the Java Platform, Standard Edition 18.The version introduced by the Java Platform, Standard Edition 19.The version introduced by the Java 2 Platform, Standard Edition, v 1.2.The version introduced by the Java Platform, Standard Edition 20.The version introduced by the Java Platform, Standard Edition 21.The version introduced by the Java Platform, Standard Edition 22.The version introduced by the Java Platform, Standard Edition 23.The version introduced by the Java Platform, Standard Edition 24.The version introduced by the Java 2 Platform, Standard Edition, v 1.3.The version introduced by the Java 2 Platform, Standard Edition, v 1.4.The version introduced by the Java 2 Platform, Standard Edition 5.0.The version introduced by the Java Platform, Standard Edition 6.The version introduced by the Java Platform, Standard Edition 7.The version introduced by the Java Platform, Standard Edition 8.The version introduced by the Java Platform, Standard Edition 9. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isIdentifier
(CharSequence name) Returns whether or notname
is a syntactically valid identifier (simple name) or keyword in the latest source version.static boolean
Returns whether or nots
is a keyword, a boolean literal, or the null literal in the latest source version.static boolean
isKeyword
(CharSequence s, SourceVersion version) Returns whether or nots
is a keyword, a boolean literal, or the null literal in the given source version.static boolean
isName
(CharSequence name) Returns whether or notname
is a syntactically valid qualified name in the latest source version.static boolean
isName
(CharSequence name, SourceVersion version) Returns whether or notname
is a syntactically valid qualified name in the given source version.static SourceVersion
latest()
Returns the latest source version that can be modeled.static SourceVersion
Returns the latest source version fully supported by the current execution environment.Returns the least runtime version that supports this source version; otherwisenull
.static SourceVersion
Returns the latest source version that is usable under the runtime version argument.static SourceVersion
Returns the enum constant of this class with the specified name.static SourceVersion[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RELEASE_0
The original version. The language described in The Java Language Specification, First Edition. -
RELEASE_1
The version introduced by the Java Platform 1.1. The language isRELEASE_0
augmented with nested classes as described in the 1.1 update to The Java Language Specification, First Edition. -
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 thestrictfp
modifier. -
RELEASE_3
The version introduced by the Java 2 Platform, Standard Edition, v 1.3. No major changes fromRELEASE_2
. -
RELEASE_4
The version introduced by the Java 2 Platform, Standard Edition, v 1.4. Added a simple assertion facility.- See Also:
-
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, enhancedfor
loop, and hexadecimal floating-point literals.- See Also:
-
RELEASE_6
The version introduced by the Java Platform, Standard Edition 6. No major changes fromRELEASE_5
.- See Also:
-
RELEASE_7
The version introduced by the Java Platform, Standard Edition 7. Additions in this release include diamond syntax for constructors,try
-with-resources, strings in switch, binary literals, and multi-catch.- Since:
- 1.7
- See Also:
-
RELEASE_8
The version introduced by the Java Platform, Standard Edition 8. Additions in this release include lambda expressions and default methods.- Since:
- 1.8
- See Also:
-
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.- Since:
- 9
- See Also:
-
RELEASE_10
The version introduced by the Java Platform, Standard Edition 10. Additions in this release include local-variable type inference (var
).- Since:
- 10
- See Also:
-
RELEASE_11
The version introduced by the Java Platform, Standard Edition 11. Additions in this release include local-variable syntax for lambda parameters.- Since:
- 11
- See Also:
-
RELEASE_12
The version introduced by the Java Platform, Standard Edition 12. No major changes from the prior release.- Since:
- 12
- See Also:
-
RELEASE_13
The version introduced by the Java Platform, Standard Edition 13. No major changes from the prior release.- Since:
- 13
- See Also:
-
RELEASE_14
The version introduced by the Java Platform, Standard Edition 14. Additions in this release include switch expressions.- Since:
- 14
- See Also:
-
RELEASE_15
The version introduced by the Java Platform, Standard Edition 15. Additions in this release include text blocks.- Since:
- 15
- See Also:
-
RELEASE_16
The version introduced by the Java Platform, Standard Edition 16. Additions in this release include records and pattern matching forinstanceof
.- Since:
- 16
- See Also:
-
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.- Since:
- 17
- See Also:
-