Package javax.faces.validator

Examples of javax.faces.validator.BeanValidator$FacesMessageInterpolator


        // controller.verify();
        return validators;
    }

    private void setupBeanValidator(ValidatorDescriptor... validators) {
        expect(input.getValidators()).andStubReturn(new Validator[] { new BeanValidator() });
        expect(validatorService.getConstrains(environment.getFacesContext(), expression, null, DEFAULT_GROUP)).andStubReturn(
            Lists.newArrayList(validators));
    }
View Full Code Here


        if (defaultValidator != null && defaultValidator instanceof BeanValidator) {
            if (beanValidator instanceof FacesBeanValidator) {
                FacesBeanValidator facesBeanValidator = (FacesBeanValidator) beanValidator;
                facesBeanValidator.setValidateFields(false);
            }
            BeanValidator defaultBeanValidator = (BeanValidator) defaultValidator;
            Class<?>[] groups = parameterObject.getGroups();
            if(null ==  defaultBeanValidator.getValidationGroups() && null != groups && groups.length >0){
                defaultBeanValidator.setValidationGroups(GROUPS_JOINER.join(Iterables.transform(Arrays.asList(groups), CLASS_TO_NAME)));
            }
        }

        if (addBeanValidator) {
            input.addValidator(beanValidator);
View Full Code Here

                }
               
                // special things to configure for a BeanValidator
                if (validator instanceof BeanValidator)
                {
                    BeanValidator beanValidator = (BeanValidator) validator;
                   
                    // check the validationGroups
                    String validationGroups =  beanValidator.getValidationGroups();
                    if (validationGroups == null
                            || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
                    {
                        // no validationGroups available
                        // --> get the validationGroups from the stack
                        String stackGroup = actx.getFirstValidationGroupFromStack();
                        if (stackGroup != null)
                        {
                            validationGroups = stackGroup;
                        }
                        else
                        {
                            // no validationGroups on the stack
                            // --> set the default validationGroup
                            validationGroups = javax.validation.groups.Default.class.getName();
                        }
                        beanValidator.setValidationGroups(validationGroups);
                    }
                }
            }
        }
    }
View Full Code Here

        }
       
        // special things to configure for a BeanValidator
        if (validator instanceof BeanValidator)
        {
            BeanValidator beanValidator = (BeanValidator) validator;
           
            // check the validationGroups
            String validationGroups =  beanValidator.getValidationGroups();
            if (validationGroups == null
                    || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
            {
                // no validationGroups available
                // --> get the validationGroups from the stack
                //String stackGroup = mctx.getFirstValidationGroupFromStack();
                //if (stackGroup != null)
                //{
                //    validationGroups = stackGroup;
                //}
                //else
                //{
                    // no validationGroups on the stack
                    // --> set the default validationGroup
                    validationGroups = javax.validation.groups.Default.class.getName();
                //}
                beanValidator.setValidationGroups(validationGroups);
            }
        }
    }
View Full Code Here

                validator = context.getApplication().createValidator(validatorId);

                // special things to configure for a BeanValidator
                if (validator instanceof BeanValidator)
                {
                    BeanValidator beanValidator = (BeanValidator) validator;
                   
                    // check the validationGroups
                    String validationGroups =  beanValidator.getValidationGroups();
                    if (validationGroups == null
                            || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
                    {
                        // no validationGroups available
                        // --> get the validationGroups from the stack
                        //String stackGroup = mctx.getFirstValidationGroupFromStack();
                        //if (stackGroup != null)
                        //{
                        //    validationGroups = stackGroup;
                        //}
                        //else
                        //{
                            // no validationGroups on the stack
                            // --> set the default validationGroup
                            validationGroups = javax.validation.groups.Default.class.getName();
                        //}
                        beanValidator.setValidationGroups(validationGroups);
                    }
                }
               
                // add the validator to the component
                component.addValidator(validator);
View Full Code Here

        }
       
        // special things to configure for a BeanValidator
        if (validator instanceof BeanValidator)
        {
            BeanValidator beanValidator = (BeanValidator) validator;
           
            // check the validationGroups
            String validationGroups =  beanValidator.getValidationGroups();
            if (validationGroups == null
                    || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
            {
                // no validationGroups available
                // --> get the validationGroups from the stack
                String stackGroup = mctx.getFirstValidationGroupFromStack();
                if (stackGroup != null)
                {
                    validationGroups = stackGroup;
                }
                else
                {
                    // no validationGroups on the stack
                    // --> set the default validationGroup
                    validationGroups = javax.validation.groups.Default.class.getName();
                }
                beanValidator.setValidationGroups(validationGroups);
            }
        }
    }
View Full Code Here

                validator = context.getApplication().createValidator(validatorId);

                // special things to configure for a BeanValidator
                if (validator instanceof BeanValidator)
                {
                    BeanValidator beanValidator = (BeanValidator) validator;
                   
                    // check the validationGroups
                    String validationGroups =  beanValidator.getValidationGroups();
                    if (validationGroups == null
                            || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
                    {
                        // no validationGroups available
                        // --> get the validationGroups from the stack
                        //String stackGroup = mctx.getFirstValidationGroupFromStack();
                        //if (stackGroup != null)
                        //{
                        //    validationGroups = stackGroup;
                        //}
                        //else
                        //{
                            // no validationGroups on the stack
                            // --> set the default validationGroup
                            validationGroups = javax.validation.groups.Default.class.getName();
                        //}
                        beanValidator.setValidationGroups(validationGroups);
                    }
                }
               
                // add the validator to the component
                component.addValidator(validator);
View Full Code Here

     * @param input
     * @return
     */
    private String _getValidationGroups(UIInput input)
    {
        BeanValidator validator = _getValidator(input, BeanValidator.class);
        if (validator != null)
        {
            return validator.getValidationGroups();
        }
        return null;
    }
View Full Code Here

        }
       
        // special things to configure for a BeanValidator
        if (validator instanceof BeanValidator)
        {
            BeanValidator beanValidator = (BeanValidator) validator;
           
            // check the validationGroups
            String validationGroups =  beanValidator.getValidationGroups();
            if (validationGroups == null
                    || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
            {
                // no validationGroups available
                // --> get the validationGroups from the stack
                //String stackGroup = mctx.getFirstValidationGroupFromStack();
                //if (stackGroup != null)
                //{
                //    validationGroups = stackGroup;
                //}
                //else
                //{
                    // no validationGroups on the stack
                    // --> set the default validationGroup
                    validationGroups = javax.validation.groups.Default.class.getName();
                //}
                beanValidator.setValidationGroups(validationGroups);
            }
        }
    }
View Full Code Here

                validator = context.getApplication().createValidator(validatorId);

                // special things to configure for a BeanValidator
                if (validator instanceof BeanValidator)
                {
                    BeanValidator beanValidator = (BeanValidator) validator;
                   
                    // check the validationGroups
                    String validationGroups =  beanValidator.getValidationGroups();
                    if (validationGroups == null
                            || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
                    {
                        // no validationGroups available
                        // --> get the validationGroups from the stack
                        //String stackGroup = mctx.getFirstValidationGroupFromStack();
                        //if (stackGroup != null)
                        //{
                        //    validationGroups = stackGroup;
                        //}
                        //else
                        //{
                            // no validationGroups on the stack
                            // --> set the default validationGroup
                            validationGroups = javax.validation.groups.Default.class.getName();
                        //}
                        beanValidator.setValidationGroups(validationGroups);
                    }
                }
               
                // add the validator to the component
                component.addValidator(validator);
View Full Code Here

TOP

Related Classes of javax.faces.validator.BeanValidator$FacesMessageInterpolator

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.