Package-level declarations

Types

Link copied to clipboard
expect annotation class CriticalNative

Marks a function as not requiring JNI environment and a class/object reference.

Marks a function as not requiring JNI environment and a class/object reference. A function will be exposed to JVM like a regular JNI function AND almost the same one with JavaCritical_ prefix (instead of standard Java_) will be exposed.

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
actual annotation class CriticalNative

Marks a JniActual function as a JNI critical native function. Such a function does not receive a JniEnv or a JClass/JObject reference. Its parameters and return value must be primitives or primitive arrays only.

Link copied to clipboard

An alias to dalvik.annotation.optimization.FastNative on android, ignored on JVM.

expect annotation class FastNative

An alias to dalvik.annotation.optimization.FastNative on android, ignored on JVM.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class JniActual(val className: String, val methodName: String = "")

Indicates that a function (public or internal) is the actual implementation of a function expected to be provided through JNI.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class JniActuals(val className: String = "")

Instead of duplicating the className parameter in each JniActual annotation, you can use this one.

Link copied to clipboard

Indicates that a function is expected to have its implementation provided through JNI.

Link copied to clipboard
annotation class JniExpects(val targets: String = [])

Instead of repeating the JniExpect annotation, you can apply this annotation to the entire class, object or file.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class JniOnLoad

The function annotated with this annotation will be called when the native library is loaded (for example, through System.loadLibrary).

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class JniOnUnload

The function annotated with this annotation will be called when the class loader containing the native library is garbage collected.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class LoadMethod

Annotates a function that loads the native library:

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class WithJvmSignature(val parameterTypes: Array<String>, val returnType: String)

Adds information about jvm signature for functions annotated with JniActual.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.TYPE])
annotation class WithJvmType(val type: String)

Adds information about according jvm type for this type.