@Test public void testFindBestMethodWithSignature_StringAndMethodName() throws Exception { ReflectionHelper helper = new ReflectionHelper(FakeInterface.class); Class[] signatureSought = new Class[] {String.class}; Method theMethod = helper.findBestMethodWithSignature("methodString", signatureSought ); assertNotNull("Failed to find method for args: " + signatureSought, theMethod); Class[] signatureFound = theMethod.getParameterTypes(); Class[] signatureExpected = signatureSought; assertEquals("Wrong class", theMethod.getDeclaringClass().getName(), FakeInterface.class.getName()); helpAssertSameMethodSignature("Found wrong method signature", signatureExpected, signatureFound); }
public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } ReflectionHelper( Class<?> targetClass ); }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } ReflectionHelper( Class<?> targetClass ); Method findBestMethodOnTarget( String methodName, Object[] arguments ); Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ); Method findBestMethodWithSignature( String methodName, List<Class<?>> argumentsClasses ); static final Object create(String className, Collection<?> ctorObjs,
                                      final ClassLoader classLoader); static final Object create(String className, Object[] ctorObjs, Class<?>[] argTypes,
                final ClassLoader classLoader); }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } ReflectionHelper( Class<?> targetClass ); Method findBestMethodOnTarget( String methodName, Object[] arguments ); Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ); Method findBestMethodWithSignature( String methodName, List<Class<?>> argumentsClasses ); static final Object create(String className, Collection<?> ctorObjs,
                                      final ClassLoader classLoader); static final Object create(String className, Object[] ctorObjs, Class<?>[] argTypes,
                final ClassLoader classLoader);  }