public static < T > Constructor < T > resolveConstructor ( Class < T > type , Class < ? > [ ] parameterTypes , Object ... arguments ) { try { return getConstructor ( type , parameterTypes ) ; } catch ( ConstructorNotFoundException cause ) { Constructor < T > constructor = findConstructor ( type , arguments ) ; Assert . notNull ( constructor , new ConstructorNotFoundException ( String . format ( "Failed to resolve constructor with signature [%1$s] on class type [%2$s]" , getMethodSignature ( getSimpleName ( type ) , parameterTypes , Void . class ) , getName ( type ) ) , cause . getCause ( ) ) ) ; return constructor ; } }
Attempts to resolve the constructor from the given class type based on the constructor s exact signature otherwise finds a constructor who s signature parameter types satisfy the array of Object arguments .