Package br.com.caelum.stella.validation

Examples of br.com.caelum.stella.validation.NITValidator


    /**
     * @see org.hibernate.validator.Validator#initialize(java.lang.annotation.Annotation)
     */
    public void initialize(NIT nit) {
        AnnotationMessageProducer messageProducer = new AnnotationMessageProducer(nit);
        stellaValidator = new NITValidator(messageProducer, nit.formatted());
    }
View Full Code Here


    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        NITValidator validator = new NITValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        }
        catch (InvalidStateException e) {
            List<ValidationMessage> messages = e.getInvalidMessages();
            String firstErrorMessage = messages.remove(0).getMessage();
            registerAllMessages(facesContext, uiComponent, messages);
View Full Code Here

    String bundleName = application.getMessageBundle();
    Locale locale = facesContext.getViewRoot().getLocale();
    ResourceBundle bundle = ResourceBundle.getBundle(bundleName, locale);

    ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
    NITValidator validator = new NITValidator(producer, formatted);

    try {
      validator.assertValid(value.toString());
    }
    catch (InvalidStateException e){
      List<ValidationMessage> messages = e.getInvalidMessages();
      String firstErrorMessage = messages.remove(0).getMessage();
      registerAllMessages(facesContext, uiComponent, messages);
View Full Code Here

    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        NITValidator validator = new NITValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
            List<ValidationMessage> messages = e.getInvalidMessages();
            String firstErrorMessage = messages.remove(0).getMessage();
            registerAllMessages(facesContext, uiComponent, messages);
            throw new ValidatorException(new FacesMessage(firstErrorMessage));
View Full Code Here

    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        NITValidator validator = new NITValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
            List<ValidationMessage> messages = e.getInvalidMessages();
            String firstErrorMessage = messages.remove(0).getMessage();
            registerAllMessages(facesContext, uiComponent, messages);
            throw new ValidatorException(new FacesMessage(firstErrorMessage));
View Full Code Here

  private NITValidator stellaValidator;

  public void initialize(NIT nit) {
    AnnotationMessageProducer messageProducer = new AnnotationMessageProducer(
        nit);
    stellaValidator = new NITValidator(messageProducer, nit.formatted());
  }
View Full Code Here

   * @see org.hibernate.validator.Validator#initialize(java.lang.annotation.Annotation)
   */
  public void initialize(NIT nit) {
    AnnotationMessageProducer messageProducer = new AnnotationMessageProducer(
        nit);
    stellaValidator = new NITValidator(messageProducer, nit.formatted());
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.stella.validation.NITValidator

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.