src/it/finsiel/siged/util/ObjectCreator.java
private static Object createObject(Class classObject, Object[] params)
            throws Exception {

        Constructor[] constructors = classObject.getConstructors();
        Object object = null;
        for (int i = 0; i < constructors.length; i++) {
            try {
                object = constructors[i].newInstance(params);
            } catch (Exception e) {

                if (e instanceof InvocationTargetException) {
                    ((InvocationTargetException) e).getTargetException()
                            .printStackTrace();
                }
                // Do nothing, try the next constructor
            }
        }
        if (object == null) {
            throw new InstantiationException();
        }
        return object;
    }
/**
     * @param classObject
     * @param params
     *            an array including the required parameters to instantiate the
     *            object
     * @return Exception
     */
@param classObject
@param params
an array including the required parameters to instantiate the
object
@return Exception
@param classObject @param params an array including the required parameters to instantiate the object @return Exception
private static Object createObject(Class classObject, Object[] params)
            throws Exception {
        Constructor[] constructors = classObject.getConstructors();
        Object object = null;
        for (int i = 0; i < constructors.length; i++) {
            try {
                object = constructors[i].newInstance(params);
            } catch (Exception e) {
                if (e instanceof InvocationTargetException) {
                    ((InvocationTargetException) e).getTargetException()
                            .printStackTrace();
                }
            }
        }
        if (object == null) {
            throw new InstantiationException();
        }
        return object;
    }
private static Object createObject ( Class classObject , Object [ ] params ) throws Exception { Constructor [ ] constructors = classObject . getConstructors ( ) ; Object object = null ; for ( int i = 0 ; i < constructors . length ; i ++ ) { try { object = constructors [ i ] . newInstance ( params ) ; } catch ( Exception e ) { if ( e instanceof InvocationTargetException ) { ( ( InvocationTargetException ) e ) . getTargetException ( ) . printStackTrace ( ) ; } } } if ( object == null ) { throw new InstantiationException ( ) ; } return object ; }
@param classObject
 @param params
            an array including the required parameters to instantiate the
            object
 @return Exception
@param classObject @param params an array including the required parameters to instantiate the object @return Exception
// Do nothing, try the next constructor