Package one.nio.util
Class MethodHandlesReflection
- java.lang.Object
-
- one.nio.util.MethodHandlesReflection
-
public class MethodHandlesReflection extends Object
Allows to lookup information about available Class' methods using java.lang.invoke API, when the standard getDeclaredMethods() fail with NoClassDefFoundError due to some missing class file. All lookups are made recursively through parent classes.
-
-
Field Summary
Fields Modifier and Type Field Description static MethodHandles.LookupprivateLookup
-
Constructor Summary
Constructors Constructor Description MethodHandlesReflection()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MethodHandleInfofindInstanceMethod(Class<?> cls, String name, MethodType type)static MethodHandleInfofindInstanceMethodOrThrow(Class<?> cls, String name, MethodType type)static MethodHandleInfofindStaticMethod(Class<?> cls, String name, MethodType type)static MethodHandleInfofindStaticMethodOrThrow(Class<?> cls, String name, MethodType type)
-
-
-
Field Detail
-
privateLookup
public static final MethodHandles.Lookup privateLookup
-
-
Method Detail
-
findInstanceMethod
public static MethodHandleInfo findInstanceMethod(Class<?> cls, String name, MethodType type)
-
findInstanceMethodOrThrow
public static MethodHandleInfo findInstanceMethodOrThrow(Class<?> cls, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException
-
findStaticMethod
public static MethodHandleInfo findStaticMethod(Class<?> cls, String name, MethodType type)
-
findStaticMethodOrThrow
public static MethodHandleInfo findStaticMethodOrThrow(Class<?> cls, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException
-
-