@Test
public void writeMethodDetail(){
getMethodName("gcj_wyxj_common.Text");
}
/**
* 通过反射获取某类下的方法名和参数名
* @Description
* @author zhangyd-c
* @date 2015年10月26日 上午11:14:22
* @param className
*/
public static void getMethodName(String className){
try {
Class> clazz = Class.forName(className);
Method[] methods = clazz.getMethods();
String methodName = null;
String paramName = null;
for(Method method : methods){
System.out.println("无敌分隔线开始" + System.currentTimeMillis());
methodName = method.getName();
System.err.println("方法名:" + methodName);
Class> returnTypes = method.getReturnType();
System.err.println("返回值类型" + returnTypes.getName());
Class>[] paramNames = method.getParameterTypes();
for(Class> cla : paramNames){
paramName = cla.getName();
System.err.println("参数名 : " + paramName);
}
System.out.println("无敌分隔线结束" + System.currentTimeMillis());
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}