public final class MethodHandleUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static MethodHandle |
compose(MethodHandle f,
MethodHandle g) |
static MethodHandle |
compose(MethodHandle f,
MethodHandle g,
MethodHandle h) |
static MethodHandle |
methodHandle(Class<?> clazz,
String name,
Class<?>... parameterTypes)
Returns a MethodHandle corresponding to the specified method.
|
static MethodHandle |
nativeValueGetter(Type type) |
static MethodHandle |
nativeValueWriter(Type type) |
public static MethodHandle compose(MethodHandle f, MethodHandle g)
f - (U, S1, S2, ..., Sm)Rg - (T1, T2, ..., Tn)Upublic static MethodHandle compose(MethodHandle f, MethodHandle g, MethodHandle h)
f - (U, V)Rg - (S1, S2, ..., Sm)Uh - (T1, T2, ..., Tn)Vpublic static MethodHandle methodHandle(Class<?> clazz, String name, Class<?>... parameterTypes)
Warning: The way Oracle JVM implements producing MethodHandle for a method involves creating JNI global weak references. G1 processes such references serially. As a result, calling this method in a tight loop can create significant GC pressure and significantly increase application pause time.
public static MethodHandle nativeValueGetter(Type type)
public static MethodHandle nativeValueWriter(Type type)
Copyright © 2012–2022. All rights reserved.