Annotation Interface ByReference


@Retention(CLASS) @Target({METHOD,PARAMETER}) public @interface ByReference
Instruments the native bridge processor to marshall annotated method return type or method parameter as a reference to a foreign object.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The class to instantiate for a foreign handle.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    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.
  • Element Details

    • value

      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.
    • useCustomReceiverAccessor

      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:
      Default:
      false