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

Examples of org.apache.myfaces.extensions.validator.beanval.ExtValBeanValidationContext


                            new ExtValBeanValidator(((BeanValidator)validator).getValidationGroups()));
                }
            }
        }

        ExtValBeanValidationContext beanValidationContext = ExtValBeanValidationContext.getCurrentInstance();
        Class currentClass;
        for(String groupClassName : groupsClassNamesOfTagList)
        {
            currentClass = ClassUtils.tryToLoadClassForName(groupClassName.trim());

            if(currentClass != null && currentClass.isInterface())
            {
                beanValidationContext.addGroup(currentClass, viewId, clientId);
            }
            else
            {
                this.logger.severe(groupClassName + " is no valid group - only existing interfaces are allowed");
            }
View Full Code Here


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

                                             List<Class> restrictedGroupsForPropertyValidation,
                                             List<ModelValidationEntry> modelValidationEntryList,
                                             List<Class> restrictedGroupsForModelValidation,
                                             String activeViewId)
    {
        ExtValBeanValidationContext extValBeanValidationContext = ExtValBeanValidationContext.getCurrentInstance();

        String clientId = component.getClientId(FacesContext.getCurrentInstance());

        processFoundGroups(extValBeanValidationContext, activeViewId, clientId,
                foundGroupsForPropertyValidation);
View Full Code Here

                                             List<Class> restrictedGroupsForPropertyValidation,
                                             List<ModelValidationEntry> modelValidationEntryList,
                                             List<Class> restrictedGroupsForModelValidation,
                                             String activeViewId)
    {
        ExtValBeanValidationContext extValBeanValidationContext = ExtValBeanValidationContext.getCurrentInstance();

        String clientId = component.getClientId(FacesContext.getCurrentInstance());

        processFoundGroups(extValBeanValidationContext, activeViewId, clientId,
                foundGroupsForPropertyValidation);
View Full Code Here

                            new ExtValBeanValidator(((BeanValidator)validator).getValidationGroups()));
                }
            }
        }

        ExtValBeanValidationContext beanValidationContext = ExtValBeanValidationContext.getCurrentInstance();
        Class currentClass;
        for(String groupClassName : groupsClassNamesOfTagList)
        {
            currentClass = ClassUtils.tryToLoadClassForName(groupClassName.trim());

            if(currentClass != null && currentClass.isInterface())
            {
                beanValidationContext.addGroup(currentClass, viewId, clientId);
            }
            else
            {
                this.logger.severe(groupClassName + " is no valid group - only existing interfaces are allowed");
            }
View Full Code Here

                                             List<Class> foundGroupsForPropertyValidation,
                                             List<Class> restrictedGroupsForPropertyValidation,
                                             List<ModelValidationEntry> modelValidationEntryList,
                                             List<Class> restrictedGroupsForModelValidation)
    {
        ExtValBeanValidationContext extValBeanValidationContext = ExtValBeanValidationContext.getCurrentInstance();
        String currentViewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();

        String clientId = component.getClientId(FacesContext.getCurrentInstance());

        processFoundGroups(extValBeanValidationContext, currentViewId, clientId,
View Full Code Here

                                             List<Class> restrictedGroupsForPropertyValidation,
                                             List<ModelValidationEntry> modelValidationEntryList,
                                             List<Class> restrictedGroupsForModelValidation,
                                             String activeViewId)
    {
        ExtValBeanValidationContext extValBeanValidationContext = ExtValBeanValidationContext.getCurrentInstance();

        String clientId = component.getClientId(FacesContext.getCurrentInstance());

        processFoundGroups(extValBeanValidationContext, activeViewId, clientId,
                foundGroupsForPropertyValidation);
View Full Code Here

                                             List<Class> foundGroupsForPropertyValidation,
                                             List<Class> restrictedGroupsForPropertyValidation,
                                             List<ModelValidationEntry> modelValidationEntryList,
                                             List<Class> restrictedGroupsForModelValidation)
    {
        ExtValBeanValidationContext extValBeanValidationContext = ExtValBeanValidationContext.getCurrentInstance();
        String currentViewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();

        String clientId = component.getClientId(FacesContext.getCurrentInstance());

        processFoundGroups(extValBeanValidationContext, currentViewId, clientId,
View Full Code Here

                                             List<Class> restrictedGroupsForPropertyValidation,
                                             List<ModelValidationEntry> modelValidationEntryList,
                                             List<Class> restrictedGroupsForModelValidation,
                                             String activeViewId)
    {
        ExtValBeanValidationContext extValBeanValidationContext = ExtValBeanValidationContext.getCurrentInstance();

        String clientId = component.getClientId(FacesContext.getCurrentInstance());

        processFoundGroups(extValBeanValidationContext, activeViewId, clientId,
                foundGroupsForPropertyValidation);
View Full Code Here

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

TOP

Related Classes of org.apache.myfaces.extensions.validator.beanval.ExtValBeanValidationContext

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.