Package br.com.caelum.vraptor.validator

Examples of br.com.caelum.vraptor.validator.I18nMessage


  /**
   * This method is called when the {@link SizeLimitExceededException} was thrown.
   */
  protected void reportSizeLimitExceeded(final SizeLimitExceededException e, Validator validator) {
    validator.add(new I18nMessage("upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize()));
    logger.warn("The file size limit was exceeded. Actual {} permitted {}", e.getActualSize(), e.getPermittedSize());
  }
View Full Code Here


    validator.add(new I18nMessage("upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize()));
    logger.warn("The file size limit was exceeded. Actual {} permitted {}", e.getActualSize(), e.getPermittedSize());
  }

  protected void reportFileUploadException(FileUploadException e, Validator validator) {
    validator.add(new I18nMessage("upload", "file.upload.exception"));
    logger.warn("There was some problem parsing this multipart request, "
        + "or someone is not sending a RFC1867 compatible multipart request.", e);
  }
View Full Code Here

  public List<Message> getErrors() {
    return errors;
  }
 
  public boolean containsMessage(String messageKey, Object... messageParameters) {
    I18nMessage expectedMessage = new I18nMessage("validation", messageKey, messageParameters);
    expectedMessage.setBundle(ResourceBundle.getBundle("messages"));
    for(Message error : this.getErrors()) {
      if(expectedMessage.getMessage().equals(error.getMessage())) {
        return true;
      }
    }

    return false;
View Full Code Here

    this.category = category;
    this.severity = severity;
  }

  public ConversionMessage(String key, Object... parameters) {
    this("",new I18nMessage("", key, parameters));
  }
View Full Code Here

  public ConversionMessage(String key, Object... parameters) {
    this("",new I18nMessage("", key, parameters));
  }

  public ConversionMessage(String key, Severity severity, Object... parameters) {
    this("",new I18nMessage("", key, parameters),severity);
  }
View Full Code Here

   * maxRequestSize() attributes in a Filter.
   *
   * @param e
   */
  protected void reportSizeLimitExceeded(final IllegalStateException e) {
    validator.add(new I18nMessage("upload", "servlet3.upload.filesize.exceeded"));
    logger.warn("The file size limit was exceeded.", e);
  }
View Full Code Here

  public ConversionMessage(Message message) {
    this.message = message;
  }

  public ConversionMessage(String key, Object... parameters) {
    this.message = new I18nMessage("", key, parameters);
    this.category = "";
  }
View Full Code Here

    this.container = container;
    this.bundle = bundle;
  }

  public I18nMessageSerialization from(String category, String key, Object...params) {
    i18nMessage = new I18nMessage(category, key, params);
    i18nMessage.setBundle(bundle);
    return this;
  }
View Full Code Here

   * This method is called when the {@link SizeLimitExceededException} was thrown.
   *
   * @param e
   */
  protected void reportSizeLimitExceeded(final SizeLimitExceededException e) {
    validator.add(new I18nMessage("upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize()));
    logger.warn("The file size limit was exceeded.", e);
  }
View Full Code Here

  public List<Message> getErrors() {
    return errors;
  }
 
  public boolean containsMessage(String messageKey, Object... messageParameters) {
    I18nMessage expectedMessage = new I18nMessage("validation", messageKey, messageParameters);
    expectedMessage.setBundle(ResourceBundle.getBundle("messages"));
    for(Message error : this.getErrors()) {
      if(expectedMessage.getMessage().equals(error.getMessage())) {
        return true;
      }
    }

    return false;
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.validator.I18nMessage

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.