BeanUtil { public static String getMethodSignature(final Method method) { StringBuilder sbuf = new StringBuilder(); sbuf.append(method.getName()); sbuf.append('('); Class<?>[] paramTypes = method.getParameterTypes(); if (CommonUtil.isNotEmpty(paramTypes)) { for (Class<?> clazz : paramTypes) { sbuf.append(clazz.getName()).append(','); } } sbuf.append(')'); return sbuf.toString(); }  static boolean isAbstract(final Method method); static String[] getMethodParamNames(final Class<?> clazz, final String method, final Class<?>... paramTypes); static String[] getMethodParamNames(final Method method); static String getMethodSignature(final Method method); static Set<Class<?>> getClasses(final String pk); static String toUnderlineName(final String s); static String toCamelCase(final String str); static String camelStr2underLine(final String camelStr); static String toCapitalizeCamelCase(final String str); static boolean isSimpleValueType(final Class<?> clazz); static boolean isSimpleProperty(final Class<?> clazz);  }
@Test public void getMethodSignature() { Method[] methods = Bootstrap.class.getDeclaredMethods(); Method method = methods[1]; String name = BeanUtil.getMethodSignature(method); Assert.equals(name, "after(org.springframework.context.ApplicationContext,)", ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("获取到了Bootstrap after方法的签名"); }