Set<Map.Entry<String, String>> validatorInfoSet = validators.entrySet();
for (Map.Entry<String, String> entry : validatorInfoSet)
{
String validatorId = entry.getKey();
String validatorClassName = entry.getValue();
Validator enclosingValidator = null;
if (validatorClassName == null)
{
// we have no class name for validators of enclosing <f:validateBean> tags
// --> we have to create it to get the class name
// note that normally we can use this instance later anyway!
enclosingValidator = application.createValidator(validatorId);
validatorClassName = enclosingValidator.getClass().getName();
}
// check if the validator is already registered for the given component
// this happens if <f:validateBean /> is nested inside the component on the view
Validator validator = null;
for (Validator v : component.getValidators())
{
if (v.getClass().getName().equals(validatorClassName))
{
// found