Package org.objenesis.strategy
Class PlatformDescription
java.lang.Object
org.objenesis.strategy.PlatformDescription
List of constants describing the currently used platform.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Android version.static final String
JVM_NAME prefix for Dalvik/Androidstatic final String
Deprecated.No need to differentiate GAE anymore since they have stopped using a security managerstatic final String
JVM_NAME prefix for GCJstatic final String
JVM_NAME prefix for Java HotSpotstatic final boolean
Flag telling if this version of Android is based on the OpenJDKstatic final String
JVM namestatic final String
JVM_NAME prefix for the OpenJDKstatic final String
JVM_NAME prefix for Aonix PERCstatic final String
Java specification versionstatic final String
Deprecated.UseHOTSPOT
insteadstatic final String
VM vendor namestatic final String
VM vendor versionstatic final String
JVM versionstatic final String
JVM version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Describes the platform.private static int
private static int
private static String
Deprecated.No need to differentiate GAE anymore since they have stopped using a security managerprivate static boolean
private static int
getOldAndroidVersion
(Class<?> versionClass) static boolean
Tells if the current JVM is running Java 11 or abovestatic boolean
Tells if the current JVM is running Java 9 or abovestatic boolean
Check if this JVM is an Android JVM based on OpenJDK.static boolean
Deprecated.No need to differentiate GAE anymore since they have stopped using a security managerstatic boolean
Check if the current JVM is of the type passed in parameter.
-
Field Details
-
GNU
JVM_NAME prefix for GCJ- See Also:
-
HOTSPOT
JVM_NAME prefix for Java HotSpot- See Also:
-
SUN
Deprecated.UseHOTSPOT
insteadJVM_NAME prefix for Java HotSpot- See Also:
-
OPENJDK
JVM_NAME prefix for the OpenJDK- See Also:
-
PERC
JVM_NAME prefix for Aonix PERC- See Also:
-
DALVIK
JVM_NAME prefix for Dalvik/Android- See Also:
-
SPECIFICATION_VERSION
Java specification version -
VM_VERSION
JVM version -
VM_INFO
JVM version -
VENDOR_VERSION
VM vendor version -
VENDOR
VM vendor name -
JVM_NAME
JVM name -
ANDROID_VERSION
public static final int ANDROID_VERSIONAndroid version. Will be 0 for none android platform -
IS_ANDROID_OPENJDK
public static final boolean IS_ANDROID_OPENJDKFlag telling if this version of Android is based on the OpenJDK -
GAE_VERSION
Deprecated.No need to differentiate GAE anymore since they have stopped using a security managerGoogle App Engine version or null is we are not on GAE
-
-
Constructor Details
-
PlatformDescription
private PlatformDescription()
-
-
Method Details
-
describePlatform
Describes the platform. Outputs Java version and vendor.- Returns:
- Description of the current platform
-
isThisJVM
Check if the current JVM is of the type passed in parameter. Normally, this will be a constant from this class. We basically doSystem.getProperty("java.vm.name").startWith(name)
.- Parameters:
name
- jvm name we are looking for- Returns:
- if it's the requested JVM
-
isAndroidOpenJDK
public static boolean isAndroidOpenJDK()Check if this JVM is an Android JVM based on OpenJDK.- Returns:
- if it's an Android version based on the OpenJDK. Will return false if this JVM isn't an Android JVM at all
-
getIsAndroidOpenJDK
private static boolean getIsAndroidOpenJDK() -
isAfterJigsaw
public static boolean isAfterJigsaw()Tells if the current JVM is running Java 9 or above- Returns:
- if the current JVM is Java 9 or above
-
isAfterJava11
public static boolean isAfterJava11()Tells if the current JVM is running Java 11 or above- Returns:
- if the current JVM is Java 11 or above
-
isGoogleAppEngine
Deprecated.No need to differentiate GAE anymore since they have stopped using a security managerTells if the platform running the JVM is Google App Engine.- Returns:
- are we running on Google App Engine
-
getGaeRuntimeVersion
Deprecated.No need to differentiate GAE anymore since they have stopped using a security managerGive the GAE Java version used. To know if it was before or after the restricting security manager.- Returns:
- Java runtime version on GAE. Null if not on GEA
-
getAndroidVersion
private static int getAndroidVersion() -
getAndroidVersion0
private static int getAndroidVersion0() -
getOldAndroidVersion
-