@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface Platform
A class or method annotated with only value() or not()
lets Generator know for which platforms it should generate code
(or not). The strings are matched with String.startsWith(String).
In particular, @Platform(value="") matches all platforms, while
@Platform(not="") matches no platforms, providing a way to specify
methods to skip or classes to ignore, as if they did not exist.
Classes annotated with at least one of the other values define a top-enclosing
class as returned by Loader.getEnclosingClass(Class). By default, one
native library gets created for each such class, but Builder recognizes
more than one class with the same library() name and produces only one
library in that case.
Further, with the Properties annotation, properties can be inherited
from other classes, and different properties can be defined for each platform.
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String[] |
cinclude
A list of C header files to include at the top of the generated code.
|
java.lang.String[] |
compiler
A list of options applied for the native compiler.
|
java.lang.String[] |
define
A list of macros to
#define at the top of the generated code,
before include() and cinclude() header files. |
java.lang.String[] |
exclude
A list of C/C++ header files that should not be included in the generated code,
even when they are inherited from an include list.
|
java.lang.String |
executable
An executable to bundle at build time and extract at runtime on load, instead of a library.
|
java.lang.String[] |
executablepath
A list of paths from which to copy executables from the
executable() value. |
java.lang.String[] |
extension
The platform extensions to attempt to load for this library.
|
java.lang.String[] |
framework
A list of frameworks the native compiler should build against.
|
java.lang.String[] |
frameworkpath
A list of framework paths passed to the native compiler for use at link time.
|
java.lang.String[] |
include
A list of C++ header files to include at the top of the generated code.
|
java.lang.String[] |
includepath
A list of include paths passed to the native compiler.
|
java.lang.String[] |
includeresource
A list of include resources passed to the native compiler.
|
java.lang.String |
library
|
java.lang.String[] |
link
A list of libraries the native compiler should link with.
|
java.lang.String[] |
linkpath
A list of library paths passed to the native compiler for use at link time.
|
java.lang.String[] |
linkresource
A list of library resources passed to the native compiler for use at link time.
|
java.lang.String[] |
not
The properties, class, or method do NOT apply to the named platforms.
|
java.lang.String[] |
pragma
A list of
pragma directives to list at the top of the generated
code, before define() macros and any included header files. |
java.lang.String[] |
preload
A list of libraries, in addition to
link(), that should be extracted and preloaded, if possible. |
java.lang.String[] |
preloadpath
|
java.lang.String[] |
preloadresource
|
java.lang.String[] |
resource
A list of resources, either files or directories, that can be copied and extracted.
|
java.lang.String[] |
resourcepath
A list of paths from which to copy resources from the
resource() list. |
java.lang.String[] |
value
The properties, class, or method apply only to the named platforms.
|
public abstract java.lang.String[] value
String.startsWith(String)public abstract java.lang.String[] not
String.startsWith(String)public abstract java.lang.String[] pragma
pragma directives to list at the top of the generated
code, before define() macros and any included header files.public abstract java.lang.String[] define
#define at the top of the generated code,
before include() and cinclude() header files.public abstract java.lang.String[] exclude
public abstract java.lang.String[] include
public abstract java.lang.String[] cinclude
#include directives will be generated in a extern "C" { } block.public abstract java.lang.String[] includepath
public abstract java.lang.String[] includeresource
public abstract java.lang.String[] compiler
Builder uses the "platform.compiler.default" property.public abstract java.lang.String[] linkpath
public abstract java.lang.String[] linkresource
public abstract java.lang.String[] link
public abstract java.lang.String[] frameworkpath
public abstract java.lang.String[] framework
public abstract java.lang.String[] preload
link(), that should be extracted and preloaded, if possible.
Accepts "@" + optional version tag and "#" + a second optional name used at extraction (or empty to prevent it).public abstract java.lang.String[] resourcepath
resource() list.public abstract java.lang.String[] resource
public abstract java.lang.String[] extension
public abstract java.lang.String[] executablepath
executable() value.public abstract java.lang.String executable
public abstract java.lang.String library
Builder should
try to build and Loader should try to load. If left empty, this value
defaults to "jni" + the name that Class.getSimpleName() returns for
Properties.target() or Properties.global() class, or this class, if not given.