* or it may be omitted if the argument is declared to take a concrete type;
* or {@link Class#getSimpleName} may be used in case the argument type is {@link Describable}
* and only one subtype is registered (as a {@link Descriptor}) with that simple name.
*/
public static <T> T instantiate(Class<? extends T> clazz, Map<String,?> arguments) throws Exception {
ClassDescriptor d = new ClassDescriptor(clazz);
String[] names = d.loadConstructorParamNames();
Constructor<T> c = findConstructor(clazz, names.length);
Object[] args = buildArguments(clazz, arguments, c.getGenericParameterTypes(), names, true);
T o = c.newInstance(args);
injectSetters(o, arguments);
return o;