...
- Exact invocation: The
invokeExact
method requires the caller and callee method types to have identical components. This method is public, safe, and signature-polymorphic. - Generic invocation: The generic
invoke
method allows the caller and callee method types to differ, as long as the callee can be viewed under the caller type, using theasType
method. This As a consequence, this mode offers on-the-fly argument and return conversions. This method is public, safe, and signature-polymorphic. - Varargs invocation: The overloaded
invokeWithArguments
method allow an arbitrary varargs array or list of untyped arguments to be applied to a callee, and the call succeeds as long as the callee can be viewed under an implied caller type determined as if byMethodType.genericType
. This method is public. - Basic invocation: The
invokeBasic
method requires that the caller and callee method types have corresponding components, but allows any reference to match any other reference. Because there is no runtime check for this condition, nor for reference compatibility, this method is non-public and must be used carefully. It is used by trusted code to implement the other invocation modes. It is signature-polymorphic. - Invokedynamic invocation: The
invokedynamic
instruction implicitly performs an exact invocation on the target of its resolved call site. (Unlike the other modes, the callee is not visible as a receiver on the JVM expression stack.) Because the system ensures that all call site targets have pre-checked callee method types, the system may use basic invocation as an implementation option.Invokedynamic invocation: The
In addition, method handles can be viewed by various transforms that change their apparent type, and hence their acceptable invocation types and modes:
...
Overview
Content Tools
ThemeBuilder