try {
String validatorClass = _validatorClassMap.get(validatorId);
if (validatorClass == null)
throw new FacesException(L.l("'{0}' is not a known validator.",
validatorId));
Thread thread = Thread.currentThread();
ClassLoader loader = thread.getContextClassLoader();
Class cl = Class.forName(validatorClass, false, loader);
return (Validator) cl.newInstance();
}
catch (FacesException e) {
throw e;
}
catch (Exception e) {
throw new FacesException(e);
}
}