public interface Platform
A platform group (e.g., an architecture or OS) is an interface extending Platform
. A leaf
platform, e.g., a supported architecture-OS-combination, is a class that implements all the
groups that it belongs to. A leaf platform class must be non-abstract and must have a no-argument
constructor. It is good practice to make leaf platform classes final
(to prevent
accidental subclassing) and to avoid state (i.e., no fields).
The annotation Platforms
restricts a type, method, or field to certain platform groups or
leaf platforms.
This system makes the set of platform groups and leaf platforms extensible. Some standard platforms are defined as inner classes.
Modifier and Type | Interface and Description |
---|---|
static interface |
Platform.AARCH64
Supported architecture: ARMv8 64-bit.
|
static interface |
Platform.AMD64
Supported architecture: x86 64-bit.
|
static interface |
Platform.ANDROID
Supported operating system: Android.
|
static class |
Platform.ANDROID_AARCH64
Supported leaf platform: Android on AArch64 64-bit.
|
static interface |
Platform.DARWIN
Basis for all Apple operating systems (MacOS and iOS).
|
static interface |
Platform.DARWIN_AARCH64
Basis for all Apple operating systems on AMD64 (MACOS_AMD64 & IOS_AMD64).
|
static interface |
Platform.DARWIN_AMD64
Basis for all Apple operating systems on AMD64 (MACOS_AMD64 & IOS_AMD64).
|
static class |
Platform.HOSTED_ONLY
Marker for elements (types, methods, or fields) that are only visible during native image
generation and cannot be used at run time, regardless of the actual platform.
|
static interface |
Platform.IOS
Supported operating system: iOS.
|
static class |
Platform.IOS_AARCH64
Supported leaf platform: iOS on AArch 64-bit.
|
static class |
Platform.IOS_AMD64
Supported leaf platform: iOS on x86 64-bit.
|
static interface |
Platform.LINUX
Supported operating system: Linux.
|
static class |
Platform.LINUX_AARCH64
Supported leaf platform: Linux on AArch64 64-bit.
|
static interface |
Platform.LINUX_AARCH64_BASE
Basis for all Linux operating systems on AARCH64 (LINUX_AARCH64 & ANDROID_AARCH64).
|
static class |
Platform.LINUX_AMD64
Supported leaf platform: Linux on x86 64-bit.
|
static interface |
Platform.LINUX_AMD64_BASE
Basis for all Linux operating systems on AMD64 (LINUX_AMD64).
|
static class |
Platform.LINUX_RISCV64
Supported leaf platform: Linux on RISC-V 64-bit.
|
static interface |
Platform.MACOS
Supported operating system: MacOS.
|
static class |
Platform.MACOS_AARCH64
Supported leaf platform: MacOS on AArch 64-bit.
|
static class |
Platform.MACOS_AMD64
Supported leaf platform: MacOS on x86 64-bit.
|
static interface |
Platform.RISCV64
Supported architecture: RISC-V 64-bit.
|
static interface |
Platform.WINDOWS
Supported operating system: Windows.
|
static class |
Platform.WINDOWS_AARCH64
Supported leaf platform: Windows on AArch 64-bit.
|
static class |
Platform.WINDOWS_AMD64
Supported leaf platform: Windows on x86 64-bit.
|
Modifier and Type | Field and Description |
---|---|
static String |
PLATFORM_PROPERTY_NAME
The system property name that specifies the fully qualified name of the
Platform
implementation class that should be used. |
Modifier and Type | Method and Description |
---|---|
default String |
getArchitecture()
Returns the string representing Platform's architecture name.
|
default String |
getOS()
Returns the string representing Platform's OS name.
|
static boolean |
includedIn(Class<? extends Platform> platformGroup)
Returns true if the current platform (the platform that the native image is built for) is
included in the provided platform group.
|
static final String PLATFORM_PROPERTY_NAME
Platform
implementation class that should be used. If the property is not specified, the platform
class is inferred from the standard architectures and operating systems specified in this
file, i.e., in most cases it is not necessary to use this property.static boolean includedIn(Class<? extends Platform> platformGroup)
The platformGroup must be a compile-time constant, so that the call to this method can be replaced with the constant boolean result.
default String getOS()
This method should be implemented either in a final class or as default method in respective OS interface.
default String getArchitecture()
This method should be implemented either in final class or as default method in respective architecture interface.