Package javax.faces.validator

Examples of javax.faces.validator.Validator.validate()


      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


      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

      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

       
        assertEquals("input validator", 1, input.getValidators().length);
       
        Validator v = input.getValidators()[0];
       
        v.validate(faces, input, "4333");
    }
   
    public void testValidateDoubleRangeHandler() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
View Full Code Here

       
        assertEquals("input validator", 1, input.getValidators().length);
       
        Validator v = input.getValidators()[0];
       
        v.validate(faces, input, new Double(1.8));
    }
   
    public void testValidateLengthHandler() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
View Full Code Here

       
        assertEquals("input validator", 1, input.getValidators().length);
       
        Validator v = input.getValidators()[0];
       
        v.validate(faces, input, "beans");
    }
   
    public void testValidateLongRangeHandler() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
View Full Code Here

       
        assertEquals("input validator", 1, input.getValidators().length);
       
        Validator v = input.getValidators()[0];
       
        v.validate(faces, input, new Long(2000));
    }
   
    public void testValueChangeListenerHandler() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
View Full Code Here

    @Override
    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        String validatorId = (String) uiComponent.getAttributes().get(VALIDATOR_ID);
        Validator validator = lookup(facesContext, validatorId);
        validator.validate(facesContext, uiComponent, value);
    }

    private Validator lookup(FacesContext facesContext, String validatorId) {
        return facesContext.getApplication().createValidator(validatorId);
    }
View Full Code Here

           Validator instance = createValidator(validatorId, binding, context);


            if (instance != null) {
                instance.validate(context, component, value);
            } else {
                throw new ValidatorException(
                     MessageUtils.getExceptionMessage(
                          MessageUtils.CANNOT_VALIDATE_ID,
                          validatorId != null ? validatorId.getExpressionString() : "",
View Full Code Here

        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

TOP
Copyright © 2018 www.massapi.com. 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.