common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java
public static Constructor<?> getConstructor(Class<?> clazz, Object... args)
            throws SecurityException, NoSuchMethodException {
        Constructor<?> constructor = null;
        int length = args.length;
        Class<?>[] classes = new Class<?>[length];
        for (int i = 0; i < length; i++) {
            Object object = args[i];
            classes[i] = object.getClass();
        }
        constructor = clazz.getConstructor(classes);
        return constructor;
    }
public static Constructor<?> getConstructor(Class<?> clazz, Object... args)
            throws SecurityException, NoSuchMethodException {
        Constructor<?> constructor = null;
        int length = args.length;
        Class<?>[] classes = new Class<?>[length];
        for (int i = 0; i < length; i++) {
            Object object = args[i];
            classes[i] = object.getClass();
        }
        constructor = clazz.getConstructor(classes);
        return constructor;
    }
public static Constructor < ? > getConstructor ( Class < ? > clazz , Object ... args ) throws SecurityException , NoSuchMethodException { Constructor < ? > constructor = null ; int length = args . length ; Class < ? > [ ] classes = new Class < ? > [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { Object object = args [ i ] ; classes [ i ] = object . getClass ( ) ; } constructor = clazz . getConstructor ( classes ) ; return constructor ; }
根据传入的给予构造参数的传入值获取构造方法 <br>
2013-10-21 上午11:03:13

@param clazz 调用的类对象
@param args  传入的参数
@return 如果存在，则返回构造方法，如果不存在，则返回空
@throws NoSuchMethodException
@throws SecurityException
根据传入的给予构造参数的传入值获取构造方法 <br > 2013 - 10 - 21 上午11 : 03 : 13