Class MultiMethod
java.lang.Object
org.aksw.commons.util.reflect.MultiMethod
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> MethodfindInvocationMethod(Class<T> clazz, Class<?> returnType, Class<?>... args) Find the best matching methods for the given types.static <T> MethodfindInvocationMethod(Class<T> clazz, String name, Object... args) Deprecated.static <T> MethodfindMethodByArgs(Class<T> clazz, String name, Object... args) static <T> MethodfindMethodByParams(Class<T> clazz, String name, Class<?>... typeSignature) static <T> MethodfindMethodByParamsCached(Class<T> clazz, String name, List<Class<?>> typeSignature) Errors on lookup (such as no or multiple candidates) ar not cached in will result in new lookups.findMethodCandidates(Class<T> clazz, String name, Class<?>... typeSignature) findMethodCandidates(Collection<Method> candidates, Class<?>... typeSignature) static <X> Xstatic <T,X> X invokeStatic(Class<T> clazz, String name, Object... args) Invoke the method of an object, that matches the name and arguments best.
-
Constructor Details
-
MultiMethod
public MultiMethod()
-
-
Method Details
-
invokeStatic
Invoke the method of an object, that matches the name and arguments best. TODO Add some caching mechanism- Type Parameters:
T-- Parameters:
clazz-name-args-- Throws:
InvocationTargetExceptionIllegalAccessExceptionIllegalArgumentException
-
invoke
-
findMethodCandidates
-
findMethodCandidates
-
findMethodByParamsCached
-
findMethodByParams
-
findInvocationMethod
@Deprecated public static <T> Method findInvocationMethod(Class<T> clazz, String name, Object... args) Deprecated. -
findMethodByArgs
-
findInvocationMethod
-