@Test public void testAllowOverloads() { HelloWorld hw = new HelloWorld(); hw.called1st = false; hw.called2nd = false; Invoker.invokeOverloaded( hw, "sayHi2", "Rick" ); if ((!hw.called1st)) { die(""); } if ((hw.called2nd)) { die(""); } }
public static Object invokeOverloaded(Object object, String name, Object... args) { ClassMeta classMeta = ClassMeta.classMeta(object.getClass()); Iterable<MethodAccess> invokers = classMeta.methods(name); for (MethodAccess m : invokers) { if (m.respondsTo(args)) { return m.invoke(object, args); } } return die(Object.class, "Unable to invoke method", name, "on object", object, "with arguments", args); }
Invoker { public static Object invokeOverloaded(Object object, String name, Object... args) { ClassMeta classMeta = ClassMeta.classMeta(object.getClass()); Iterable<MethodAccess> invokers = classMeta.methods(name); for (MethodAccess m : invokers) { if (m.respondsTo(args)) { return m.invoke(object, args); } } return die(Object.class, "Unable to invoke method", name, "on object", object, "with arguments", args); } }
Invoker { public static Object invokeOverloaded(Object object, String name, Object... args) { ClassMeta classMeta = ClassMeta.classMeta(object.getClass()); Iterable<MethodAccess> invokers = classMeta.methods(name); for (MethodAccess m : invokers) { if (m.respondsTo(args)) { return m.invoke(object, args); } } return die(Object.class, "Unable to invoke method", name, "on object", object, "with arguments", args); }  }
Invoker { public static Object invokeOverloaded(Object object, String name, Object... args) { ClassMeta classMeta = ClassMeta.classMeta(object.getClass()); Iterable<MethodAccess> invokers = classMeta.methods(name); for (MethodAccess m : invokers) { if (m.respondsTo(args)) { return m.invoke(object, args); } } return die(Object.class, "Unable to invoke method", name, "on object", object, "with arguments", args); }  static Object invokeOverloadedFromObject(Object object, String name, Object args); static Object invokeOverloadedFromObject(boolean respectIgnore, String view,
                                                    Set<String> ignoreProperties,
                                                    Object object, String name,
                                                    Object args); static Object invokeFromObject(Object object, String name, Object args); static Object invokeFromObject(Class<?> cls, String name, Object args); static Object invokeMethodFromObjectArg(Object object, MethodAccess method, Object args); static Object invokeMethodFromObjectArg(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                          Object object, MethodAccess method, Object args); static Object invokeFromObject(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                          Object object, String name, Object args); static Object invokeFromObject(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                          Class<?> cls, Object object, String name, Object args); static Object invokeFromList(Object object, String name, List<?> args); static Object invokeFromList(Class<?> cls, String name, List<?> args); static Object invokeFromList(boolean respectIgnore, String view, Set<String> ignoreProperties, Object object, String name, List<?> args); static Object invokeFromList(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                        Class<?> cls, Object object,
                                        String name, List<?> argsList); static Object invokeMethodFromList(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                              Object object, MethodAccess method, List<?> argsList); static Object invokeEither(Object object, String name, Object... args); static Object invoke(Object object, String name, Object... args); static MethodAccess invokeMethodAccess( Object object, String name ); static MethodAccess invokeMethodAccess(Class<?> cls, String name); static Object invoke(Class cls, String name, Object... args); static Object invokeOverloaded(Object object, String name, Object... args); static Object invokeOverloadedFromList(Object object, String name, List<?> args); static Object invokeOverloadedFromList(boolean respectIgnore,
                                                  String view,
                                                  Set<String> ignoreProperties,
                                                  Object object,
                                                  String name,
                                                  List<?> args); static void invokeMethodWithAnnotationNoReturn(Object object, String annotation); static void invokeMethodWithAnnotationWithReturnType(Object object, String annotation, Class<?> returnType); static void invokeMethodWithAnnotationWithReturnType(Class<?> type, Object object, String annotation, Class<?> returnType); static boolean invokeBooleanReturn(Object object, T v); static Object invokeReducer(Object object, Object sum, Object value); static Object invokeFunction(Object object, Object arg); static MethodAccess invokeFunctionMethodAccess(Object object); static ConstantCallSite invokeReducerLongIntReturnLongMethodHandle(Object object ); static ConstantCallSite invokeReducerLongIntReturnLongMethodHandle(T object, String methodName ); static Method invokeReducerLongIntReturnLongMethod(Object object ); static Method invokeReducerLongIntReturnLongMethod(T object, String methodName ); static boolean matchAndConvertArgs( boolean respectIgnore,
                                               String view,
                                               FieldsAccessor fieldsAccessor,
                                               List<Object> convertedArgumentList,
                                               BaseAccess methodAccess,
                                               Class[] parameterTypes,
                                               int index,
                                               Set<String> ignoreSet,
                                               boolean[] flag, boolean loose); }
Invoker { public static Object invokeOverloaded(Object object, String name, Object... args) { ClassMeta classMeta = ClassMeta.classMeta(object.getClass()); Iterable<MethodAccess> invokers = classMeta.methods(name); for (MethodAccess m : invokers) { if (m.respondsTo(args)) { return m.invoke(object, args); } } return die(Object.class, "Unable to invoke method", name, "on object", object, "with arguments", args); }  static Object invokeOverloadedFromObject(Object object, String name, Object args); static Object invokeOverloadedFromObject(boolean respectIgnore, String view,
                                                    Set<String> ignoreProperties,
                                                    Object object, String name,
                                                    Object args); static Object invokeFromObject(Object object, String name, Object args); static Object invokeFromObject(Class<?> cls, String name, Object args); static Object invokeMethodFromObjectArg(Object object, MethodAccess method, Object args); static Object invokeMethodFromObjectArg(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                          Object object, MethodAccess method, Object args); static Object invokeFromObject(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                          Object object, String name, Object args); static Object invokeFromObject(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                          Class<?> cls, Object object, String name, Object args); static Object invokeFromList(Object object, String name, List<?> args); static Object invokeFromList(Class<?> cls, String name, List<?> args); static Object invokeFromList(boolean respectIgnore, String view, Set<String> ignoreProperties, Object object, String name, List<?> args); static Object invokeFromList(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                        Class<?> cls, Object object,
                                        String name, List<?> argsList); static Object invokeMethodFromList(boolean respectIgnore, String view, Set<String> ignoreProperties,
                                              Object object, MethodAccess method, List<?> argsList); static Object invokeEither(Object object, String name, Object... args); static Object invoke(Object object, String name, Object... args); static MethodAccess invokeMethodAccess( Object object, String name ); static MethodAccess invokeMethodAccess(Class<?> cls, String name); static Object invoke(Class cls, String name, Object... args); static Object invokeOverloaded(Object object, String name, Object... args); static Object invokeOverloadedFromList(Object object, String name, List<?> args); static Object invokeOverloadedFromList(boolean respectIgnore,
                                                  String view,
                                                  Set<String> ignoreProperties,
                                                  Object object,
                                                  String name,
                                                  List<?> args); static void invokeMethodWithAnnotationNoReturn(Object object, String annotation); static void invokeMethodWithAnnotationWithReturnType(Object object, String annotation, Class<?> returnType); static void invokeMethodWithAnnotationWithReturnType(Class<?> type, Object object, String annotation, Class<?> returnType); static boolean invokeBooleanReturn(Object object, T v); static Object invokeReducer(Object object, Object sum, Object value); static Object invokeFunction(Object object, Object arg); static MethodAccess invokeFunctionMethodAccess(Object object); static ConstantCallSite invokeReducerLongIntReturnLongMethodHandle(Object object ); static ConstantCallSite invokeReducerLongIntReturnLongMethodHandle(T object, String methodName ); static Method invokeReducerLongIntReturnLongMethod(Object object ); static Method invokeReducerLongIntReturnLongMethod(T object, String methodName ); static boolean matchAndConvertArgs( boolean respectIgnore,
                                               String view,
                                               FieldsAccessor fieldsAccessor,
                                               List<Object> convertedArgumentList,
                                               BaseAccess methodAccess,
                                               Class[] parameterTypes,
                                               int index,
                                               Set<String> ignoreSet,
                                               boolean[] flag, boolean loose);  }