try {
final Class klass = Classes.forNameByThread(clsnm);
if (cls != null && !cls.isAssignableFrom(klass)) {
String msg = clsnm+" must implement "+cls.getName()+", "+el.getLocator();
if (required)
throw new UiException(msg);
log.error(msg);
return null;
}
// if (log.debuggable()) log.debug("Using "+clsnm+" for "+cls);
return klass;
} catch (Throwable ex) {
String msg = ex instanceof ClassNotFoundException ?
clsnm + " not found": "Unable to load "+clsnm;
msg += ", at "+el.getLocator();
if (required)
throw new UiException(msg, ex);
log.error(msg);
return null;
}
} else if (required)
throw new UiException(elnm+" required, at "+el.getLocator());
return null;
}