public static < T > T callConstructor ( Class < T > targetClass , Class [ ] argClasses , Object [ ] args ) { T output ; try { Constructor classConstructor = targetClass . getDeclaredConstructor ( argClasses ) ; output = AccessController . doPrivileged ( new SetConstructorPrivilegedAction < T > ( classConstructor , args ) ) ; } catch ( NoSuchMethodException e ) { throw new ParcelerRuntimeException ( "Exception during method injection: NoSuchMethodException" , e ) ; } catch ( PrivilegedActionException e ) { throw new ParcelerRuntimeException ( "PrivilegedActionException Exception during field injection" , e ) ; } catch ( Exception e ) { throw new ParcelerRuntimeException ( "Exception during field injection" , e ) ; } return output ; }
Instantiates a class by calling the constructor .