Package javax.faces.validator

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


        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


      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

        for (int i = 0; i < values.length; i++) {
            if (values[i].trim().length() == 0) {
                continue;
            }
            else try {
                validator.validate(facesContext, uiComponent, values[i]);
            }
            catch (ValidatorException e) {
                facesMsg = addMessage(facesMsg, e.getFacesMessage(), i, suffixMessageKey);
            }
        }
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

        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

           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

   public void validateConvertedValue(FacesContext facesContext, Object value)
   {
      Validator validator = getValidator();
      if (validator!=null)
      {
         validator.validate( facesContext, facesContext.getViewRoot(), value );
      }
     
      if (valueExpression!=null)
      {
         //TODO: note that this code is duplicated from ModelValidator!!
View Full Code Here

      if (argument instanceof Validator) {
        Validator validator = (Validator) argument;
        FacesContext context = FacesContext.getCurrentInstance();
        UIComponent component = new UIInput();
        Object value = new Object();
        validator.validate(context, component, value);
        return expression.lastInvocationMatched(context, component, value);
      }
      return false;
    }
  }
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

        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.