This class is intented to be used only be JNA itself.
This implementation is inspired by: Correct Reflective Access to Interface Default Methods in Java 8, 9, 10
| Modifier and Type | Field and Description |
|---|---|
| private static Constructor | |
| private static final Logger | |
| private static final Method | |
| private static final Method | |
| private static final Method | |
| private static final Method | |
| private static final Method | |
| private static final Method | |
| private static final Method | |
| private static final Method | |
| private static final Method |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static Object | |
| private static Object | |
| private static Constructor | |
| public static Object | Returns: method handle that can be used to invoke the supplied methodRetrieve the method handle, that can be used to invoke the provided method. |
| public static Object | Returns: result of the invokationobject to invoke the supplied method handle on target, Object retrieved via methodHandle, Object... args)getMethodHandle(java.Invokes a default method reflectively. |
| public static boolean | |
| private static Class | |
| private static Constructor | |
| private static Method | |
| private static Object | |
| private static Object |
| CONSTRUCTOR_LOOKUP_CLASS | back to summary |
|---|---|
| private static Constructor<T> CONSTRUCTOR_LOOKUP_CLASS | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| METHOD_HANDLES_BIND_TO | back to summary |
|---|---|
| private static final Method METHOD_HANDLES_BIND_TO | |
| METHOD_HANDLES_INVOKE_WITH_ARGUMENTS | back to summary |
|---|---|
| private static final Method METHOD_HANDLES_INVOKE_WITH_ARGUMENTS | |
| METHOD_HANDLES_LOOKUP | back to summary |
|---|---|
| private static final Method METHOD_HANDLES_LOOKUP | |
| METHOD_HANDLES_LOOKUP_FIND_SPECIAL | back to summary |
|---|---|
| private static final Method METHOD_HANDLES_LOOKUP_FIND_SPECIAL | |
| METHOD_HANDLES_LOOKUP_IN | back to summary |
|---|---|
| private static final Method METHOD_HANDLES_LOOKUP_IN | |
| METHOD_HANDLES_LOOKUP_UNREFLECT_SPECIAL | back to summary |
|---|---|
| private static final Method METHOD_HANDLES_LOOKUP_UNREFLECT_SPECIAL | |
| METHOD_HANDLES_PRIVATE_LOOKUP_IN | back to summary |
|---|---|
| private static final Method METHOD_HANDLES_PRIVATE_LOOKUP_IN | |
| METHOD_IS_DEFAULT | back to summary |
|---|---|
| private static final Method METHOD_IS_DEFAULT | |
| METHOD_TYPE | back to summary |
|---|---|
| private static final Method METHOD_TYPE | |
| ReflectionUtils | back to summary |
|---|---|
| public ReflectionUtils() | |
| createLookup | back to summary |
|---|---|
| private static Object createLookup() throws Exception | |
| createPrivateLookupIn | back to summary |
|---|---|
| private static Object createPrivateLookupIn(Class<T> type, Object lookup) throws Exception | |
| getConstructorLookupClass | back to summary |
|---|---|
| private static Constructor | |
| getMethodHandle | back to summary |
|---|---|
| public static Object getMethodHandle(Method method) throws Exception Retrieve the method handle, that can be used to invoke the provided method. It is only intended to be used to call default methods on interfaces.
| |
| invokeDefaultMethod | back to summary |
|---|---|
| public static Object invokeDefaultMethod(Object target, Object methodHandle, Object... args) throws Throwable Invokes a default method reflectively. The method must be called with the method handle for a default method on an interfaces.
| |
| isDefault | back to summary |
|---|---|
| public static boolean isDefault(Method method) Check if the supplied method object represents a default method. This is the reflective equivalent of
| |
| lookupClass | back to summary |
|---|---|
| private static Class | |
| lookupDeclaredConstructor | back to summary |
|---|---|
| private static Constructor | |
| lookupMethod | back to summary |
|---|---|
| private static Method lookupMethod(Class<T> clazz, String methodName, Class<T>... arguments) | |
| mhViaFindSpecial | back to summary |
|---|---|
| private static Object mhViaFindSpecial(Object lookup, Method method) throws Exception | |
| mhViaUnreflectSpecial | back to summary |
|---|---|
| private static Object mhViaUnreflectSpecial(Object lookup, Method method) throws Exception | |