✗
public final enum SourceVersion
extends java.lang.Enum<javax.lang.model.SourceVersion>
Enum Constants
- ✓RELEASE_0
- ✓RELEASE_1
- ✓RELEASE_10
- ✓RELEASE_11
- ✓RELEASE_12
- ✓RELEASE_13
- ✓RELEASE_14
- ✓RELEASE_15
- ✓RELEASE_16
- ✓RELEASE_17
- ✓RELEASE_18
- ✓RELEASE_19
- ✓RELEASE_2
- ✓RELEASE_20
- ✗RELEASE_21Comparing jdk-21-ga and jdk-22+36
RELEASE_21
The version introduced by the Java Platform, Standard Edition 21. Additions in this release include record patterns and pattern matching forswitch.- Since:
- 21
- See Also:
- ①Only in: jdk-22+36; not in: jdk-21-ga.RELEASE_22Not in jdk-21-ga; only in jdk-22+36
RELEASE_22
The version introduced by the Java Platform, Standard Edition 22. Additions in this release include unnamed variables and unnamed patterns.- Since:
- 22
- See Also:
- ✓RELEASE_3
- ✓RELEASE_4
- ✓RELEASE_5
- ✓RELEASE_6
- ✓RELEASE_7
- ✓RELEASE_8
- ✓RELEASE_9
Methods
- ✗public static boolean isIdentifier(java.lang.CharSequence arg0)Comparing jdk-21-ga and jdk-22+36
isIdentifier
Returns whether or notnameis a syntactically valid identifier (simple name) or keyword in the latest source version. The method returnstrueif the name consists of an initial character for whichCharacter.isJavaIdentifierStart(int)returnstrue, followed only by characters for whichCharacter.isJavaIdentifierPart(int)returnstrue. This pattern matches regular identifiers, keywords, contextual keywords, and the literals"true","false","null". The method returnsfalsefor all other strings.- Parameters:
name- the string to check- Returns:
trueif this string is a syntactically valid identifier or keyword,falseotherwise.- See Java Language Specification:
- Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.8. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.8.3.8 Identifiers
- ✗public static boolean isKeyword(java.lang.CharSequence arg0)Comparing jdk-21-ga and jdk-22+36
isKeyword
Returns whether or notsis a keyword, boolean literal, or null literal in the latest source version. This method returnsfalsefor contextual keywords.- Parameters:
s- the string to check- Returns:
trueifsis a keyword, or boolean literal, or null literal,falseotherwise.- See Java Language Specification:
- Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9.3.9 Keywords
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.10.3.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.10.3.3.10.3 Boolean Literals
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.10.8.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.10.8.3.10.8 The Null Literal
- ✗public static boolean isKeyword(java.lang.CharSequence arg0, javax.lang.model.SourceVersion arg1)Comparing jdk-21-ga and jdk-22+36
isKeyword
Returns whether or notsis a keyword, boolean literal, or null literal in the given source version. This method returnsfalsefor contextual keywords.- Parameters:
s- the string to checkversion- the version to use- Returns:
trueifsis a keyword, or boolean literal, or null literal,falseotherwise.- See Java Language Specification:
- Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9.3.9 Keywords
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.10.3.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.10.3.3.10.3 Boolean Literals
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.10.8.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.10.8.3.10.8 The Null Literal
- Since:
- 9
- ✗public static boolean isName(java.lang.CharSequence arg0)Comparing jdk-21-ga and jdk-22+36
isName
Returns whether or notnameis a syntactically valid qualified name in the latest source version. Syntactically, a qualified name is a sequence of identifiers separated by period characters ("."). This method splits the input string into period-separated segments and applies checks to each segment in turn. UnlikeisIdentifier, this method returnsfalsefor keywords, boolean literals, and the null literal in any segment. This method returnstruefor contextual keywords.- Parameters:
name- the string to check- Returns:
trueif this string is a syntactically valid name,falseotherwise.- See Java Language Specification:
- Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9.3.9 Keywords
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.2.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.2.6.2 Names and Identifiers
- ✗public static boolean isName(java.lang.CharSequence arg0, javax.lang.model.SourceVersion arg1)Comparing jdk-21-ga and jdk-22+36
isName
Returns whether or notnameis a syntactically valid qualified name in the given source version. Syntactically, a qualified name is a sequence of identifiers separated by period characters ("."). This method splits the input string into period-separated segments and applies checks to each segment in turn. UnlikeisIdentifier, this method returnsfalsefor keywords, boolean literals, and the null literal in any segment. This method returnstruefor contextual keywords.- Parameters:
name- the string to checkversion- the version to use- Returns:
trueif this string is a syntactically valid name,falseotherwise.- See Java Language Specification:
- Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9.3.9 Keywords
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.2.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.2.6.2 Names and Identifiers
- Since:
- 9
- ✓public static javax.lang.model.SourceVersion latest()
- ✓public static javax.lang.model.SourceVersion latestSupported()
- ✓public java.lang.Runtime.Version runtimeVersion()
- ✓public static javax.lang.model.SourceVersion valueOf(java.lang.String arg0)
- ✓public static javax.lang.model.SourceVersion valueOf(java.lang.Runtime.Version arg0)
- ✓public static javax.lang.model.SourceVersion[] values()
Summary
| Elements | Comments | Descriptions | Total | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed | ||
| isIdentifier(CharSequence) | 1 | 1 | ||||||||
| isKeyword(CharSequence) | 3 | 3 | ||||||||
| isKeyword(CharSequence,SourceVersion) | 3 | 3 | ||||||||
| isName(CharSequence) | 2 | 2 | ||||||||
| isName(CharSequence,SourceVersion) | 2 | 2 | ||||||||
| RELEASE_21 | 2 | 2 | ||||||||
| RELEASE_22 | 1 | 1 | 2 | |||||||
| Total | 1 | 3 | 11 | 15 | ||||||