}
private void addDefaultValidator(FaceletContext ctx, FaceletCompositionContext mctx, FacesContext context,
EditableValueHolder component, String validatorId, String validatorClassName)
{
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 = context.getApplication().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