return callConstructor(args);
else
return callMethod(name, args);
}
catch (IllegalAccessException e) {
throw new XSLException(name + ": illegal access");
}
catch (IllegalArgumentException e) {
throw new XSLException(name + ": illegal arguments");
}
catch (InstantiationException e) {
throw new XSLException("cannot instantiate class");
}
catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
if (t instanceof RuntimeException)
throw (RuntimeException)t;
if (t instanceof Error)
throw (Error)t;
if (t instanceof Exception)
throw new XSLException((Exception)t);
throw new XSLException(e);
}
}