Package org.jboss.util.platform
Class Java
- java.lang.Object
-
- org.jboss.util.platform.Java
-
public final class Java extends java.lang.ObjectProvides common access to specifics about the version of Java that a virtual machine supports.Determines the version of the Java Virtual Machine by checking for the availablity of version specific classes.
Classes are loaded in the following order:
- java.lang.Void was introduced in JDK 1.1
- java.lang.ThreadLocal was introduced in JDK 1.2
- java.lang.StrictMath was introduced in JDK 1.3
- java.lang.StackTraceElement was introduced in JDK 1.4
- java.lang.Enum was introduced in JDK 1.5
- java.lang.management.LockInfo was introduced in JDK 1.6
- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description private static intVERSIONPrivate to avoid over optimization by the compiler.static intVERSION_1_0Java version 1.0 tokenstatic intVERSION_1_1Java version 1.1 tokenstatic intVERSION_1_2Java version 1.2 tokenstatic intVERSION_1_3Java version 1.3 tokenstatic intVERSION_1_4Java version 1.4 tokenstatic intVERSION_1_5Java version 1.5 tokenstatic intVERSION_1_6Java version 1.6 token
-
Constructor Summary
Constructors Modifier Constructor Description privateJava()Prevent instantiation
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetVersion()Return the version of Java supported by the VM.static booleanisCompatible(int version)Returns true if the current virtual machine is compatible with the given version identifer.static booleanisVersion(int version)Returns true if the given version identifer is equal to the version identifier of the current virtuial machine.
-
-
-
Field Detail
-
VERSION_1_0
public static final int VERSION_1_0
Java version 1.0 token- See Also:
- Constant Field Values
-
VERSION_1_1
public static final int VERSION_1_1
Java version 1.1 token- See Also:
- Constant Field Values
-
VERSION_1_2
public static final int VERSION_1_2
Java version 1.2 token- See Also:
- Constant Field Values
-
VERSION_1_3
public static final int VERSION_1_3
Java version 1.3 token- See Also:
- Constant Field Values
-
VERSION_1_4
public static final int VERSION_1_4
Java version 1.4 token- See Also:
- Constant Field Values
-
VERSION_1_5
public static final int VERSION_1_5
Java version 1.5 token- See Also:
- Constant Field Values
-
VERSION_1_6
public static final int VERSION_1_6
Java version 1.6 token- See Also:
- Constant Field Values
-
VERSION
private static final int VERSION
Private to avoid over optimization by the compiler.
-
-
Method Detail
-
getVersion
public static int getVersion()
Return the version of Java supported by the VM.- Returns:
- The version of Java supported by the VM.
-
isVersion
public static boolean isVersion(int version)
Returns true if the given version identifer is equal to the version identifier of the current virtuial machine.- Parameters:
version- The version identifier to check for.- Returns:
- True if the current virtual machine is the same version.
-
isCompatible
public static boolean isCompatible(int version)
Returns true if the current virtual machine is compatible with the given version identifer.- Parameters:
version- The version identifier to check compatibility of.- Returns:
- True if the current virtual machine is compatible.
-
-