org.vraptor.validator
Class BasicValidationErrors

java.lang.Object
  extended by org.vraptor.validator.BasicValidationErrors
All Implemented Interfaces:
Iterable<ValidationMessage>, ValidationErrors

public class BasicValidationErrors
extends Object
implements ValidationErrors

A basic list implementation of validation errors.

Author:
Guilherme Silveira

Constructor Summary
BasicValidationErrors()
           
BasicValidationErrors(List<ValidationMessage> errors)
           
 
Method Summary
 void add(ValidationMessage error)
          Adds a new validation error
 Iterator<ValidationMessage> getIterator()
          Retrieves an iterator
 boolean isEmptyFor(String path)
          Checks if this error collection is empty for a specific path.
 Iterator<ValidationMessage> iterator()
           
 int size()
          Returns the number of validation errors registered
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicValidationErrors

public BasicValidationErrors()

BasicValidationErrors

public BasicValidationErrors(List<ValidationMessage> errors)
Method Detail

add

public void add(ValidationMessage error)
Description copied from interface: ValidationErrors
Adds a new validation error

Specified by:
add in interface ValidationErrors
Parameters:
error - the validation error
See Also:
org.vraptor.validator.ValidationErrors#add(org.vraptor.i18n.Message)

size

public int size()
Description copied from interface: ValidationErrors
Returns the number of validation errors registered

Specified by:
size in interface ValidationErrors
Returns:
the number of validation errors
See Also:
ValidationErrors.size()

getIterator

public Iterator<ValidationMessage> getIterator()
Description copied from interface: ValidationErrors
Retrieves an iterator

Specified by:
getIterator in interface ValidationErrors
Returns:
the iterator

iterator

public Iterator<ValidationMessage> iterator()
Specified by:
iterator in interface Iterable<ValidationMessage>

toString

public String toString()
Overrides:
toString in class Object

isEmptyFor

public boolean isEmptyFor(String path)
Description copied from interface: ValidationErrors
Checks if this error collection is empty for a specific path.

Specified by:
isEmptyFor in interface ValidationErrors
Parameters:
path - the path to check
Returns:
true if its empty for that path.


Copyright © 2004-2008 VRaptor. All Rights Reserved.