Partager via


CallSite.DynamicInvoker Method

Definition

Produces a method handle equivalent to an invokedynamic instruction which has been linked to this call site.

[Android.Runtime.Register("dynamicInvoker", "()Ljava/lang/invoke/MethodHandle;", "GetDynamicInvokerHandler", ApiSince=26)]
public abstract Java.Lang.Invoke.MethodHandle? DynamicInvoker ();
[<Android.Runtime.Register("dynamicInvoker", "()Ljava/lang/invoke/MethodHandle;", "GetDynamicInvokerHandler", ApiSince=26)>]
abstract member DynamicInvoker : unit -> Java.Lang.Invoke.MethodHandle

Returns

a method handle which always invokes this call site's current target

Attributes

Remarks

Produces a method handle equivalent to an invokedynamic instruction which has been linked to this call site.

This method is equivalent to the following code: <blockquote>

{@code
            MethodHandle getTarget, invoker, result;
            getTarget = MethodHandles.publicLookup().bind(this, "getTarget", MethodType.methodType(MethodHandle.class));
            invoker = MethodHandles.exactInvoker(this.type());
            result = MethodHandles.foldArguments(invoker, getTarget)
            }

</blockquote>

Java documentation for java.lang.invoke.CallSite.dynamicInvoker().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to