ValidationErrors.java :  » Web-Framework » vraptor » org » vraptor » validator » Java Open Source

Java Open Source » Web Framework » vraptor 
vraptor » org » vraptor » validator » ValidationErrors.java
package org.vraptor.validator;

import java.util.Iterator;

import org.vraptor.i18n.ValidationMessage;

/**
 * Collection of validation errors. List is not used as there should be limited
 * access to some methods.
 * 
 * @author Guilherme Silveira
 */
public interface ValidationErrors extends Iterable<ValidationMessage> {

  /**
   * Adds a new validation error
   * 
   * @param error
   *            the validation error
   */
  void add(ValidationMessage error);

  /**
   * Returns the number of validation errors registered
   * 
   * @return the number of validation errors
   */
  int size();

  /**
   * Retrieves an iterator
   * 
   * @return the iterator
   */
  Iterator<ValidationMessage> getIterator();

  /**
   * Checks if this error collection is empty for a specific path.
   * 
   * @param path
   *            the path to check
   * @return true if its empty for that path.
   * @since 2.3.2
   */
  boolean isEmptyFor(String path);

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.