if(beanValidation == null)
{
return;
}
ExtValBeanValidationContext extValBeanValidationContext = ExtValBeanValidationContext.getCurrentInstance();
String viewId = facesContext.getViewRoot().getViewId();
//TODO log invalid expressions
for (String condition : beanValidation.conditions())
{
if (elHelper.isELTermWellFormed(condition) &&
elHelper.isELTermValid(facesContext, condition))
{
if (Boolean.FALSE.equals(elHelper.getValueOfExpression(
facesContext, new ValueBindingExpression(condition))))
{
return;
}
}
}
boolean skippedValidation = false;
for (Class currentGroupClass : beanValidation.useGroups())
{
if(SkipValidation.class.isAssignableFrom(currentGroupClass))
{
skippedValidation = true;
break;
}
extValBeanValidationContext.addGroup(currentGroupClass, viewId, null);
}
for (Class currentGroupClass : beanValidation.restrictGroups())
{
extValBeanValidationContext.restrictGroup(currentGroupClass, viewId, null);
}
if(skippedValidation)
{
extValBeanValidationContext.resetGroups(viewId);
extValBeanValidationContext.addGroup(SkipValidation.class, viewId, null);
extValBeanValidationContext.lockGroups(viewId);
}
}