Top Description Methods
org.graalvm.nativebridge

public @Interface ByReference

extends Annotation
Annotations
@Retention:CLASS
@Target:METHOD, PARAMETER
Imports
org.graalvm.jniutils.HSObject, java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Instruments the native bridge processor to marshall annotated method return type or method parameter as a reference to a foreign object.

Method Summary

Modifier and TypeMethod and Description
public boolean
useCustomReceiverAccessor()

For classes with a custom dispatch, when set to true the foreign object is translated by a custom receiver accessor before it's passed to the target method.

public Class<?>
value()

The class to instantiate for a foreign handle.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

useCustomReceiverAccessorback to summary
public boolean useCustomReceiverAccessor()

For classes with a custom dispatch, when set to true the foreign object is translated by a custom receiver accessor before it's passed to the target method.

See Also
CustomReceiverAccessor, CustomDispatchAccessor
valueback to summary
public Class<?> value()

The class to instantiate for a foreign handle.

For HotSpot to native calls.

  • If the bridged type is an interface, the class must be assignable to the NativeObject.
  • If the bridged type is a class, the class must have a field of the NativeObject type annotated with the EndPointHandle.
  • If the bridged has a custom dispatch, the class must be the dispatch class with a factory.

For native to HotSpot calls.

  • If the bridged type is an interface, the class must be assignable to the HSObject.
  • If the bridged type is a class, the class must have a field of the HSObject type annotated with the EndPointHandle.
  • If the bridged has a custom dispatch, the class must be a dispatch class with a factory.