public Object instantiateObject(Object... args) {
        try {
            if (instantiationMechanism != null) {
                return instantiationMechanism.invoke(objectToUseForInstantiation, args);
            }
            return constructor.newInstance(args);
        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | InstantiationException e) {
            throw new ReflectionUtils.ReflectionException(e);
        }
    }
public Object instantiateObject ( Object ... args ) { try { if ( instantiationMechanism != null ) { return instantiationMechanism . invoke ( objectToUseForInstantiation , args ) ; } return constructor . newInstance ( args ) ; } catch ( IllegalAccessException | IllegalArgumentException | InvocationTargetException | InstantiationException e ) { throw new ReflectionUtils . ReflectionException ( e ) ; } }
@param args
- A {@link Object} array that represents the set of parameters to be passed to, when instantiating a
new Object.
@return - An {@link Object} that was instantiated using the already provided instantiation mechanism.