try {
Widget w = (Widget) Class.forName(basePath + name).newInstance();
checkForDefaultInstances(w);
return w;
} catch (ClassNotFoundException e) {
throw new InvalidWidgetException(basePath + name);
} catch (InstantiationException e) {
throw new InvalidWidgetException(basePath + name);
} catch (IllegalAccessException e) {
throw new InvalidWidgetException(basePath + name);
}
}