Class ReflectionUtils
java.lang.Object
com.ensarsarajcic.neovim.java.handler.util.ReflectionUtils
Utilities for reflection required by this library, since all handlers are called reflectively
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Annotation>
List<Map.Entry<Method,T>> getMethodsAnnotatedWith
(Class<?> type, Class<T> annotation) Runs through passed type to find methods annotated with annotationstatic Object
invokeMethodWithArgs
(Object targetObject, Method method, List<?> arguments, BiFunction<Class<?>, Object, Object> mapper)
-
Method Details
-
getMethodsAnnotatedWith
public static <T extends Annotation> List<Map.Entry<Method,T>> getMethodsAnnotatedWith(Class<?> type, Class<T> annotation) Runs through passed type to find methods annotated with annotation- Type Parameters:
T
- type of annotation- Parameters:
type
- type to run throughannotation
- annotation to look for- Returns:
- list of method and annotation pairs
-
invokeMethodWithArgs
public static Object invokeMethodWithArgs(Object targetObject, Method method, List<?> arguments, BiFunction<Class<?>, Object, throws InvocationTargetException, IllegalAccessExceptionObject> mapper)
-