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 intAndroid version.static final StringJVM_NAME prefix for Dalvik/Androidstatic final StringDeprecated.No need to differentiate GAE anymore since they have stopped using a security managerstatic final StringJVM_NAME prefix for GCJstatic final StringJVM_NAME prefix for Java HotSpotstatic final booleanFlag telling if this version of Android is based on the OpenJDKstatic final StringJVM namestatic final StringJVM_NAME prefix for the OpenJDKstatic final StringJVM_NAME prefix for Aonix PERCstatic final StringJava specification versionstatic final StringDeprecated.UseHOTSPOTinsteadstatic final StringVM vendor namestatic final StringVM vendor versionstatic final StringJVM versionstatic final StringJVM version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringDescribes the platform.private static intprivate static intprivate static StringDeprecated.No need to differentiate GAE anymore since they have stopped using a security managerprivate static booleanprivate static intgetOldAndroidVersion(Class<?> versionClass) static booleanTells if the current JVM is running Java 11 or abovestatic booleanTells if the current JVM is running Java 9 or abovestatic booleanCheck if this JVM is an Android JVM based on OpenJDK.static booleanDeprecated.No need to differentiate GAE anymore since they have stopped using a security managerstatic booleanCheck 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.UseHOTSPOTinsteadJVM_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
-