Modifier and Type | Class and Description |
---|---|
protected static interface | ClassFileVersion.VersionLocator
A locator for the executing VM's Java version. |
Modifier and Type | Field and Description |
---|---|
protected static final int | BASE_VERSION
Returns the minimal version number that is legal. |
public static final ClassFileVersion | JAVA_V1
The class file version of Java 1. |
public static final ClassFileVersion | JAVA_V10
The class file version of Java 10. |
public static final ClassFileVersion | JAVA_V11
The class file version of Java 11. |
public static final ClassFileVersion | JAVA_V12
The class file version of Java 12. |
public static final ClassFileVersion | JAVA_V13
The class file version of Java 13. |
public static final ClassFileVersion | JAVA_V14
The class file version of Java 14. |
public static final ClassFileVersion | JAVA_V15
The class file version of Java 15. |
public static final ClassFileVersion | JAVA_V16
The class file version of Java 16. |
public static final ClassFileVersion | JAVA_V17
The class file version of Java 17. |
public static final ClassFileVersion | JAVA_V18
The class file version of Java 18. |
public static final ClassFileVersion | JAVA_V19
The class file version of Java 19. |
public static final ClassFileVersion | JAVA_V2
The class file version of Java 2. |
public static final ClassFileVersion | JAVA_V20
The class file version of Java 20. |
public static final ClassFileVersion | JAVA_V21
The class file version of Java 21. |
public static final ClassFileVersion | JAVA_V22
The class file version of Java 22. |
public static final ClassFileVersion | JAVA_V23
The class file version of Java 23. |
public static final ClassFileVersion | JAVA_V3
The class file version of Java 3. |
public static final ClassFileVersion | JAVA_V4
The class file version of Java 4. |
public static final ClassFileVersion | JAVA_V5
The class file version of Java 5. |
public static final ClassFileVersion | JAVA_V6
The class file version of Java 6. |
public static final ClassFileVersion | JAVA_V7
The class file version of Java 7. |
public static final ClassFileVersion | JAVA_V8
The class file version of Java 8. |
public static final ClassFileVersion | JAVA_V9
The class file version of Java 9. |
private static final long | serialVersionUID
The class's serial version UID. |
private static final ClassFileVersion. | VERSION_LOCATOR
A version locator for the executing JVM. |
private final int | versionNumber
The version number that is represented by this class file version instance. |
Access | Constructor and Description |
---|---|
protected | ClassFileVersion(int
The minor-major release number. versionNumber)Creates a wrapper for a given minor-major release of the Java class file format. |
Modifier and Type | Method and Description |
---|---|
public ClassFileVersion | Returns: This class file version but indicating the use of preview features.Returns this class file version indicating a class using preview features. |
public int | compareTo(ClassFileVersion
the object to be compared. other)Implements java. |
private static < The type of the action's resolved value. T> T | Returns: The action's resolved value.The action to execute from a privileged context. action)A proxy for |
public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
public int | Returns: The Java runtime version.Returns the Java runtime version number of this class file version. |
public short | Returns: The major version this instance represents.Returns the major version this instance represents. |
public int | Returns: The minor-major release number of this class file version.Returns the minor-major release number of this class file version. |
public short | Returns: The minor version this instance represents.Returns the minor version this instance represents. |
public int | |
public boolean | Returns: true if this version is at least of the given version.The version to check against. classFileVersion)Checks if this class file version is at least as new as the provided version. |
public boolean | Returns: true if this version is as most as new as the provided version.The version to check against. classFileVersion)Checks if this class file version is at most as new as the provided version. |
public boolean | Returns: true if this version is newer than the provided version.The version to check against. classFileVersion)Checks if this class file version is newer than the provided version. |
public boolean | Returns: true if this version is older than the provided version.The version to check against. classFileVersion)Checks if this class file version is older than the provided version. |
public boolean | Returns: true if this class file version indicates the use of preview features.Returns |
public static ClassFileVersion | Returns: The latest officially supported Java version.Returns the latest officially supported Java version when experimental support is not enabled. |
public static ClassFileVersion | |
public static ClassFileVersion | Returns: The type's class file version.The type for which to locate a class file version. type, ClassFileLocator The class file locator to query for a class file. classFileLocator)Extracts a class' class version. |
public static ClassFileVersion | Returns: The type's class file version.The type for which to locate a class file version. typeDescription, ClassFileLocator The class file locator to query for a class file. classFileLocator)Extracts a class' class version. |
public static ClassFileVersion | Returns: The supplied class file's class file version.The class file's binary representation. binaryRepresentation)Extracts a class' class version from a class file. |
public static ClassFileVersion | Returns: A wrapper for the given Java class file version.The Java version. javaVersion)Creates a class file version for a given major release of Java. |
public static ClassFileVersion | Returns: The appropriate class file version.The Java version string. javaVersionString)Returns the Java class file by its representation by a version string in accordance to the formats known to javac. |
public static ClassFileVersion | Returns: A representation of the version number.The minor-major release number. versionNumber)Creates a wrapper for a given minor-major release of the Java class file format. |
public static ClassFileVersion | Returns: The currently running Java process's class file version.Finds the highest class file version that is compatible to the current JVM version. |
public static ClassFileVersion | Returns: The currently running Java process's class file version or the fallback if locating this version is impossible.The version to fallback to if locating a class file version is not possible. fallback)Finds the highest class file version that is compatible to the current JVM version. |
public String |
BASE_VERSION | back to summary |
---|---|
protected static final int BASE_VERSION Returns the minimal version number that is legal. |
JAVA_V1 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V1 The class file version of Java 1. |
JAVA_V10 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V10 The class file version of Java 10. |
JAVA_V11 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V11 The class file version of Java 11. |
JAVA_V12 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V12 The class file version of Java 12. |
JAVA_V13 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V13 The class file version of Java 13. |
JAVA_V14 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V14 The class file version of Java 14. |
JAVA_V15 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V15 The class file version of Java 15. |
JAVA_V16 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V16 The class file version of Java 16. |
JAVA_V17 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V17 The class file version of Java 17. |
JAVA_V18 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V18 The class file version of Java 18. |
JAVA_V19 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V19 The class file version of Java 19. |
JAVA_V2 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V2 The class file version of Java 2. |
JAVA_V20 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V20 The class file version of Java 20. |
JAVA_V21 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V21 The class file version of Java 21. |
JAVA_V22 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V22 The class file version of Java 22. |
JAVA_V23 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V23 The class file version of Java 23. |
JAVA_V3 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V3 The class file version of Java 3. |
JAVA_V4 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V4 The class file version of Java 4. |
JAVA_V5 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V5 The class file version of Java 5. |
JAVA_V6 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V6 The class file version of Java 6. |
JAVA_V7 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V7 The class file version of Java 7. |
JAVA_V8 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V8 The class file version of Java 8. |
JAVA_V9 | back to summary |
---|---|
public static final ClassFileVersion JAVA_V9 The class file version of Java 9. |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID The class's serial version UID. |
VERSION_LOCATOR | back to summary |
---|---|
private static final ClassFileVersion. A version locator for the executing JVM. |
versionNumber | back to summary |
---|---|
private final int versionNumber The version number that is represented by this class file version instance. |
ClassFileVersion | back to summary |
---|---|
protected ClassFileVersion(int versionNumber) Creates a wrapper for a given minor-major release of the Java class file format.
|
asPreviewVersion | back to summary |
---|---|
public ClassFileVersion asPreviewVersion() Returns this class file version indicating a class using preview features.
|
compareTo | back to summary |
---|---|
public int compareTo(ClassFileVersion other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
|
doPrivileged | back to summary |
---|---|
private static <T> T doPrivileged(PrivilegedAction<T> action) A proxy for
|
equals | back to summary |
---|---|
public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. |
getJavaVersion | back to summary |
---|---|
public int getJavaVersion() Returns the Java runtime version number of this class file version.
|
getMajorVersion | back to summary |
---|---|
public short getMajorVersion() Returns the major version this instance represents.
|
getMinorMajorVersion | back to summary |
---|---|
public int getMinorMajorVersion() Returns the minor-major release number of this class file version.
|
getMinorVersion | back to summary |
---|---|
public short getMinorVersion() Returns the minor version this instance represents.
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
|
isAtLeast | back to summary |
---|---|
public boolean isAtLeast(ClassFileVersion classFileVersion) Checks if this class file version is at least as new as the provided version.
|
isAtMost | back to summary |
---|---|
public boolean isAtMost(ClassFileVersion classFileVersion) Checks if this class file version is at most as new as the provided version.
|
isGreaterThan | back to summary |
---|---|
public boolean isGreaterThan(ClassFileVersion classFileVersion) Checks if this class file version is newer than the provided version.
|
isLessThan | back to summary |
---|---|
public boolean isLessThan(ClassFileVersion classFileVersion) Checks if this class file version is older than the provided version.
|
isPreviewVersion | back to summary |
---|---|
public boolean isPreviewVersion() Returns
|
latest | back to summary |
---|---|
public static ClassFileVersion latest() Returns the latest officially supported Java version when experimental support is not enabled.
|
of | back to summary |
---|---|
public static ClassFileVersion of(Class<?> type) throws IOException Extracts a class' class version. The class' byte code is located by querying the
|
of | back to summary |
---|---|
public static ClassFileVersion of(Class<?> type, ClassFileLocator classFileLocator) throws IOException Extracts a class' class version.
|
of | back to summary |
---|---|
public static ClassFileVersion of(TypeDescription typeDescription, ClassFileLocator classFileLocator) throws IOException Extracts a class' class version.
|
ofClassFile | back to summary |
---|---|
public static ClassFileVersion ofClassFile(byte[] binaryRepresentation) Extracts a class' class version from a class file.
|
ofJavaVersion | back to summary |
---|---|
public static ClassFileVersion ofJavaVersion(int javaVersion) Creates a class file version for a given major release of Java. Currently, all versions reaching from Java 1 to Java 9 are supported.
|
ofJavaVersionString | back to summary |
---|---|
public static ClassFileVersion ofJavaVersionString(String javaVersionString) Returns the Java class file by its representation by a version string in accordance to the formats known to javac.
|
ofMinorMajor | back to summary |
---|---|
public static ClassFileVersion ofMinorMajor(int versionNumber) Creates a wrapper for a given minor-major release of the Java class file format.
|
ofThisVm | back to summary |
---|---|
public static ClassFileVersion ofThisVm() Finds the highest class file version that is compatible to the current JVM version. Prior to Java 9, this is achieved
by parsing the
|
ofThisVm | back to summary |
---|---|
public static ClassFileVersion ofThisVm(ClassFileVersion fallback) Finds the highest class file version that is compatible to the current JVM version. Prior to Java 9, this is achieved
by parsing the
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object. |
Modifier and Type | Class and Description |
---|---|
public static class | ClassFileVersion.VersionLocator.Resolved
A version locator for a resolved class file version. |
public static enum | ClassFileVersion.VersionLocator.Resolver
A resolver for the current VM's class file version. |
public static class | ClassFileVersion.VersionLocator.Unresolved
An unresolved version locator. |
Modifier and Type | Field and Description |
---|---|
public static final String | EARLY_ACCESS
A suffix that might indicate an early access version of Java. |
public static final String | JAVA_VERSION
The property for reading the current VM's Java version. |
Modifier and Type | Method and Description |
---|---|
public ClassFileVersion | Returns: The current VM's major version number.Locates the current VM's major version number. |
EARLY_ACCESS | back to summary |
---|---|
public static final String EARLY_ACCESS A suffix that might indicate an early access version of Java. |
JAVA_VERSION | back to summary |
---|---|
public static final String JAVA_VERSION The property for reading the current VM's Java version. |
resolve | back to summary |
---|---|
public ClassFileVersion resolve() Locates the current VM's major version number.
|
Modifier and Type | Field and Description |
---|---|
private final ClassFileVersion | classFileVersion
The resolved class file version. |
Access | Constructor and Description |
---|---|
protected | Resolved(ClassFileVersion
The resolved class file version. classFileVersion)Creates a new resolved version locator. |
Modifier and Type | Method and Description |
---|---|
public ClassFileVersion | resolve()
Implements net. |
classFileVersion | back to summary |
---|---|
private final ClassFileVersion classFileVersion The resolved class file version. |
Resolved | back to summary |
---|---|
protected Resolved(ClassFileVersion classFileVersion) Creates a new resolved version locator.
|
resolve | back to summary |
---|---|
public ClassFileVersion resolve() Implements net. Doc from net. Locates the current VM's major version number.
|
Modifier and Type | Field and Description |
---|---|
public static final ClassFileVersion. | INSTANCE
The singleton instance. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public ClassFileVersion. | |
public static ClassFileVersion. | |
public static ClassFileVersion. |
INSTANCE | back to summary |
---|---|
public static final ClassFileVersion. The singleton instance. |
Resolver | back to summary |
---|---|
private Resolver() |
run | back to summary |
---|---|
public ClassFileVersion. Implements java. Doc from java. Performs the computation. This method will be called by
|
valueOf | back to summary |
---|---|
public static ClassFileVersion. |
values | back to summary |
---|---|
public static ClassFileVersion. |
Modifier and Type | Field and Description |
---|---|
private final String | message
The message of the exception that explains the resolution error. |
Access | Constructor and Description |
---|---|
protected | Unresolved(String
The message of the exception that explains the resolution error. message)Creates an unresolved version locator. |
Modifier and Type | Method and Description |
---|---|
public ClassFileVersion | resolve()
Implements net. |
message | back to summary |
---|---|
private final String message The message of the exception that explains the resolution error. |
Unresolved | back to summary |
---|---|
protected Unresolved(String message) Creates an unresolved version locator.
|
resolve | back to summary |
---|---|
public ClassFileVersion resolve() Implements net. Doc from net. Locates the current VM's major version number.
|