public final class MoreMethodHandles extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
TRUSTED_FLAG |
| Constructor and Description |
|---|
MoreMethodHandles() |
| Modifier and Type | Method and Description |
|---|---|
static MethodHandles.Lookup |
privateLookupIn(Class<?> targetClass)
Returns a
lookup object with full capabilities to emulate all
supported bytecode behaviors, including private access, on a target class. |
static MethodHandle |
unreflect(Class<?> targetClass,
Constructor constructor)
Makes a direct method handle to
constructor. |
static MethodHandle |
unreflect(Class<?> targetClass,
Method method)
Makes a direct method handle to
method. |
static MethodHandle |
unreflect(Constructor constructor)
Makes a direct method handle to
constructor. |
static MethodHandle |
unreflect(Method method)
Makes a direct method handle to
method. |
static MethodHandle |
unreflectGetter(Class<?> targetClass,
Field field)
Produces a method handle giving read access to a reflected field.
|
static MethodHandle |
unreflectGetter(Field field)
Produces a method handle giving read access to a reflected field.
|
static MethodHandle |
unreflectSetter(Class<?> targetClass,
Field field)
Produces a method handle giving write access to a reflected field.
|
static MethodHandle |
unreflectSetter(Field field)
Produces a method handle giving write access to a reflected field.
|
public static final int TRUSTED_FLAG
@Nonnull public static MethodHandles.Lookup privateLookupIn(@Nonnull Class<?> targetClass)
lookup object with full capabilities to emulate all
supported bytecode behaviors, including private access, on a target class.targetClass - the target class@Nonnull public static MethodHandle unreflect(@Nonnull Class<?> targetClass, @Nonnull Method method)
method.targetClass - the target classmethod - the reflected methodMethodHandles.Lookup#unreflect(Method)@Nonnull public static MethodHandle unreflect(@Nonnull Method method)
method.method - the reflected methodMethodHandles.Lookup#unreflect(Method)@Nonnull public static MethodHandle unreflect(@Nonnull Class<?> targetClass, @Nonnull Constructor constructor)
constructor.targetClass - the target classconstructor - the reflected constructorMethodHandles.Lookup#unreflectConstructor(Constructor)@Nonnull public static MethodHandle unreflect(@Nonnull Constructor constructor)
constructor.constructor - the reflected constructorMethodHandles.Lookup#unreflectConstructor(Constructor)@Nonnull public static MethodHandle unreflectGetter(@Nonnull Class<?> targetClass, @Nonnull Field field)
targetClass - the target classfield - the reflected fieldMethodHandles.Lookup#unreflectGetter(Field)@Nonnull public static MethodHandle unreflectGetter(@Nonnull Field field)
field - the reflected fieldMethodHandles.Lookup#unreflectGetter(Field)@Nonnull public static MethodHandle unreflectSetter(@Nonnull Class<?> targetClass, @Nonnull Field field)
targetClass - the target classfield - the reflected fieldMethodHandles.Lookup#unreflectSetter(Field)@Nonnull public static MethodHandle unreflectSetter(@Nonnull Field field)
field - the reflected fieldMethodHandles.Lookup#unreflectSetter(Field)Copyright © 2018. All rights reserved.