Marks a bridge class field as a foreign reference handle.
When the bridged type is a class, the handle to a foreign object has to be stored in a
non-private field annotated by the
EndPointHandle
. Annotation processor uses this field
to obtain the foreign object reference. For HotSpot to native calls, the field type must be
assignable to
NativeObject
. For native to HotSpot calls, the field type must be
assignable to
HSObject
.
Example:
@GenerateHotSpotToNativeBridge(jniConfig = ExampleJNIConfig.class)
abstract class NativeCalculator extends Calculator {
@EndPointHandle final NativeObject delegate;
NativeCalculator(NativeObject delegate) {
this.delegate = delegate;
}
}