Package org.apache.myfaces.extensions.validator.beanval.annotation

Examples of org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation


        {
            //TODO log unsupported expression
            return;
        }

        BeanValidation beanValidation = actionMethod.getAnnotation(BeanValidation.class);

        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)
View Full Code Here


        {
            //TODO log unsupported expression
            return;
        }

        BeanValidation beanValidation = actionMethod.getAnnotation(BeanValidation.class);

        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)
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.