Package javax.faces.validator

Examples of javax.faces.validator.Validator


       
        assertNotNull("input", input);
       
        assertEquals("input validator", 1, input.getValidators().length);
       
        Validator v = input.getValidators()[0];
       
        v.validate(faces, input, new Double(1.8));
    }
View Full Code Here


       
        assertNotNull("input", input);
       
        assertEquals("input validator", 1, input.getValidators().length);
       
        Validator v = input.getValidators()[0];
       
        v.validate(faces, input, "beans");
    }
View Full Code Here

       
        assertNotNull("input", input);
       
        assertEquals("input validator", 1, input.getValidators().length);
       
        Validator v = input.getValidators()[0];
       
        v.validate(faces, input, new Long(2000));
    }
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

            Set<Map.Entry<String, String>> validatorInfoSet = validators.entrySet();
            for (Map.Entry<String, String> entry : validatorInfoSet)
            {
                String validatorId = entry.getKey();
                String validatorClassName = entry.getValue();
                Validator enclosingValidator = null;
               
                if (validatorClassName == null)
                {
                    // we have no class name for validators of enclosing <f:validateBean> tags
                    // --> we have to create it to get the class name
                    // note that normally we can use this instance later anyway!
                    enclosingValidator = application.createValidator(validatorId);
                    validatorClassName = enclosingValidator.getClass().getName();
                }
               
                // check if the validator is already registered for the given component
                // this happens if <f:validateBean /> is nested inside the component on the view
                Validator validator = null;
                for (Validator v : component.getValidators())
                {
                    if (v.getClass().getName().equals(validatorClassName))
                    {
                        // found
View Full Code Here

        Validator[] validators = number1.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                number1.removeValidator(validator);
            }
        }

        UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
        validators = number2.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                number2.removeValidator(validator);
            }
        }

        UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
        validators = text.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                text.removeValidator(validator);
            }
        }

        return "ok";
View Full Code Here

        if (defaultResult == null)
        {
            return null;
        }

        Validator result = ManagedArtifactResolver.resolveManagedValidator(defaultResult.getClass());

        if (result == null)
        {
            return defaultResult;
        }

        if (result instanceof ProxyMarker || ProxyUtils.isProxiedClass(result.getClass()))
        {
            return result;
        }
        else
        {
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

    }
    else
    {
      while (validators.hasNext())
      {
        Validator validator = validators.next();

        if (validator instanceof ClientValidator)
        {
          if (convertValidateInfo == null)
            convertValidateInfo = _getNewConvertValidate(clientId);
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.