Package javax.faces.validator

Examples of javax.faces.validator.Validator


        return subValidators;
    }

    @NotNull
    public static Validator createValidator(Constraint constraint) {
        Validator validator;
        if (constraint instanceof IntegerRangeConstraint) {
            IntegerRangeConstraint integerRangeConstraint = (IntegerRangeConstraint) constraint;
            LongRangeValidator longRangeValidator = new LongRangeValidator();
            Long minValue = integerRangeConstraint.getMinimum();
            if (minValue != null) {
View Full Code Here


    else
    {
      Iterator<Validator> validators = (Iterator<Validator>)getFacesBean().entries(VALIDATORS_KEY);
      while (validators.hasNext())
      {
        Validator validator = validators.next();
        try
        {
          validator.validate(context, this, newValue);
        }
        catch (ValidatorException ve)
        {
          // If the validator throws an exception, we're
          // invalid, and we need to add a message
View Full Code Here

        if (!componentTag.getCreated())
        {
            return Tag.SKIP_BODY;
        }

        Validator validator = createValidator();

        UIComponent component = componentTag.getComponentInstance();
        if (component == null)
        {
            throw new JspException("parent UIComponentTag has no UIComponent");
View Full Code Here

            {
                nestedObjects = true;
                stream.println('>'); mustClose = false;
                for (int i = 0; i < validators.length; i++)
                {
                    Validator validator = validators[i];
                    printIndent(stream, indent + 1);
                    stream.print('<');
                    stream.print(validator.getClass().getName());
                    stream.println("/>");
                }
            }
        }
View Full Code Here

    static void callValidators(FacesContext context, UIInput input, Object convertedValue)
    {
        Validator[] validators = input.getValidators();
        for (int i = 0; i < validators.length; i++)
        {
            Validator validator = validators[i];
            try
            {
                validator.validate(context, input, convertedValue);
            }
            catch (ValidatorException e)
            {
                input.setValid(false);
                FacesMessage facesMessage = e.getFacesMessage();
View Full Code Here

    {
        // first invoke the list of validator components
        Validator[] validators = input.getValidators();
        for (int i = 0; i < validators.length; i++)
        {
            Validator validator = validators[i];
            try
            {
                validator.validate(context, input, convertedValue);
            }
            catch (ValidatorException e)
            {
                input.setValid(false);
View Full Code Here

                                    mctx.addMethodExpressionTargeted(innerComponent, attributeName, actionListener);
                                }
                                else if ("validator".equals(attributeName))
                                {
                                   //First try to remove any prevous target if any
                                    Validator o = (Validator) mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
                                    if (o != null)
                                    {
                                        ((EditableValueHolder)innerComponent).removeValidator(o);
                                    }
                                   
                                    // target is EditableValueHolder
                                    Validator validator = null;
                                    // If it is a redirection, a wrapper is used to locate the right instance and call it properly.
                                    if (ccAttrMeRedirection)
                                    {
                                        validator = new RedirectMethodExpressionValueExpressionValidator(attributeNameValueExpression);
                                    }
View Full Code Here

            throw new FacesException(message);
        }

        try
        {
            Validator validator = (Validator) validatorClass.newInstance();
           
            _handleAttachedResourceDependencyAnnotations(FacesContext.getCurrentInstance(), validator);
           
            return validator;
        }
View Full Code Here

            throw new FacesException(message);
        }

        try
        {
            Validator validator = (Validator) validatorClass.newInstance();
           
            _handleAttachedResourceDependencyAnnotations(FacesContext.getCurrentInstance(), validator);
           
            return validator;
        }
View Full Code Here

            // tag is enabled --> create the validator and attach it
           
            // cast to a ValueHolder
            EditableValueHolder evh = (EditableValueHolder) parent;
            ValueExpression ve = null;
            Validator v = null;
            if (_delegate.getBinding() != null)
            {
                ve = _delegate.getBinding().getValueExpression(faceletContext, Validator.class);
                v = (Validator) ve.getValue(faceletContext);
            }
View Full Code Here

TOP

Related Classes of javax.faces.validator.Validator

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.