Class cl = s != null && s.trim().length() > 0 ? Class.forName(s) : null;
if (cl != null && !instantiationTest)
cl.getConstructors()[0].newInstance(new Object[] {});
return cl;
} catch (ClassNotFoundException e) {
throw new InvalidValueException(tag, s);
} catch (InstantiationException e) {
throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
} catch (IllegalAccessException e) {
throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
} catch (IllegalArgumentException e) {
throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
} catch (SecurityException e) {
throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
} catch (InvocationTargetException e) {
throw new InvalidValueException("Could not instantiate [" + s + "] for " + tag);
}
}