/** * Return the constructor on the supplied class that matches this signature. * * @param clazz the class whose constructor should be returned * @return the matching constructor * @throws ClassNotFoundException if the class for one of the parameters could not be loaded * @throws NoSuchMethodException if no matching constructor could be found */ public <T> Constructor<T> getConstructor(Class<T> clazz) throws ClassNotFoundException, NoSuchMethodException { if (!isConstructor) throw new AssertionError("Illegal call to getConstructor on a Method Signature"); Class<?>[] types = getParameterTypes(clazz.getClassLoader()); return clazz.getConstructor(types); }