Package javax.faces.validator

Examples of javax.faces.validator.ValidatorException


                return;
            }
        initValidator();
        if (!this.creditCardValidator.isValid(value.toString())){
            Object[] args = {value.toString()};
            throw new ValidatorException(getFacesMessage(CREDITCARD_MESSAGE_ID, args));
        }
    }
View Full Code Here


            {
                return;
            }
            if (!GenericValidator.isEmail(value.toString().trim())) {
                Object[] args = {value.toString()};
                throw new ValidatorException(getFacesMessage(EMAIL_MESSAGE_ID, args));
            }

    }
View Full Code Here

           
            org.apache.commons.validator.UrlValidator urlValidator = initValidator();
           
            if (!urlValidator.isValid(value.toString())) {
                Object[] args = {value.toString()};
                throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args));
            }

    }
View Full Code Here

        {
            if (convertedObject == null
                    || !java.util.regex.Pattern.compile(expression).matcher(
                            convertedObject.toString()).matches())
            {
                throw new ValidatorException(new FacesMessage(
                        FacesMessage.SEVERITY_ERROR,
                        getErrorMessageSummary(annotation),
                        getErrorMessageDetail(annotation).replace("{0}", expression)));
            }
        }
View Full Code Here

        }

        if ((message.getSummary() != null || message.getDetail() != null) &&
            entryOfSource.getClientId() != null && !entryOfSource.getClientId().equals(entryOfTarget.getClientId()))
        {
            ValidatorException validatorException = new ValidatorException(message);

            if(ExtValUtils.executeAfterThrowingInterceptors(
                    entryOfTarget.getComponent(), entryOfTarget.getMetaDataEntry(),
                    entryOfTarget.getConvertedObject(), validatorException, this))
            {
                facesContext.addMessage(entryOfTarget.getClientId(),
                        ExtValUtils.convertFacesMessage(validatorException.getFacesMessage()));
            }
        }
    }
View Full Code Here

            entryOfSource.getMetaDataEntry().getValue(Annotation.class), summary, details);

        if (message.getSummary() != null || message.getDetail() != null)
        {
            //TODO
            throw new ValidatorException(message);
        }
        else
        {
            //TODO logging
        }
View Full Code Here

                entryOfSource.getMetaDataEntry().getValue(Annotation.class), summary, details);

            if (message.getSummary() != null || message.getDetail() != null)
            {
                //TODO
                throw new ValidatorException(message);
            }
        }

        //just throw a new message - the error message is at the target
        throw new ValidatorException(new FacesMessage());
    }
View Full Code Here

            if(logger.isTraceEnabled())
            {
                logger.trace("start processAfterValidatorException of " + getClass().getName());
            }

            ValidatorException validatorException = new ValidatorException(
                    ExtValUtils.convertFacesMessage(e.getFacesMessage()), e.getCause());
            if (processAfterValidatorException(
                    facesContext, uiComponent, metaDataEntry, convertedObject, validatorException))
            {
                if(logger.isTraceEnabled())
View Full Code Here

    final EmailAddress emailAddress = (EmailAddress) value;

    Matcher matcher = LOCAL_PART_PATTERN.matcher(emailAddress.getLocalPart());
    if (!matcher.matches()) {
      throw new ValidatorException(MessageUtils.createErrorMessage(
          "validatorEmailLocalPart", facesContext));
    }

    matcher = DOMAIN_PATTERN.matcher(emailAddress.getDomain());
    if (!matcher.matches()) {
      throw new ValidatorException(MessageUtils.createErrorMessage(
          "validatorEmailDomain", facesContext));
    }
  }
View Full Code Here

  public void customValidator(FacesContext context, UIComponent component, Object value) throws ValidatorException {
    if (value == null) {
      return;
    }
    if (!"tobago".equalsIgnoreCase(value.toString())) {
      throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Please type in 'Tobago'",
          "Please type in 'Tobago'"));
    }
  }
View Full Code Here

TOP

Related Classes of javax.faces.validator.ValidatorException

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.