APIdia Launch Partner
Top Description Constructors Methods
jdk.internal.invoke

public final Class MhUtil

extends Object
Class Inheritance
Imports
java.lang.invoke.MethodHandle, .MethodHandles, .MethodType, .VarHandle

Static factories for certain VarHandle/MethodHandle variants.

Some methods take no receiver argument. In these cases, the receiver is the lookup class.

The methods will throw an InternalError if the lookup fails.

Here is an example of how one of these methods could be used:

lang=java static MethodHandle BAR_HANDLE = MhUtil.findVirtual(MethodHandles.lookup(), Foo.class,"bar",MethodType.methodType(int.class));
                lang=java
static MethodHandle BAR_HANDLE =
        MhUtil.findVirtual(MethodHandles.lookup(),
                Foo.class,"bar",MethodType.methodType(int.class));

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static MethodHandle
public static MethodHandle
findStatic(MethodHandles.Lookup lookup, Class<?> refc, String name, MethodType type)

public static VarHandle
public static VarHandle
findVarHandle(MethodHandles.Lookup lookup, Class<?> recv, String name, Class<?> type)

public static MethodHandle
public static MethodHandle
findVirtual(MethodHandles.Lookup lookup, Class<?> refc, String name, MethodType type)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MhUtilback to summary
private MhUtil()

Method Detail

findStaticback to summary
public static MethodHandle findStatic(MethodHandles.Lookup lookup, String name, MethodType type)
findStaticback to summary
public static MethodHandle findStatic(MethodHandles.Lookup lookup, Class<?> refc, String name, MethodType type)
findVarHandleback to summary
public static VarHandle findVarHandle(MethodHandles.Lookup lookup, String name, Class<?> type)
findVarHandleback to summary
public static VarHandle findVarHandle(MethodHandles.Lookup lookup, Class<?> recv, String name, Class<?> type)
findVirtualback to summary
public static MethodHandle findVirtual(MethodHandles.Lookup lookup, String name, MethodType type)
findVirtualback to summary
public static MethodHandle findVirtual(MethodHandles.Lookup lookup, Class<?> refc, String name, MethodType type)