获取单参数方法
/* from 时代Java公众号*/ //package com.nowjava; import java.lang.reflect.Method; public class Main { public static Method getSingleArgMethod(final Class<?> clazz, final Class<?> argClass, final String methodName) { try { return clazz.getMethod(methodName, argClass); } catch (final NoSuchMethodException e) { e.printStackTrace(); } catch (final SecurityException e) { e.printStackTrace(); } return null; } }