public class ValidationErrors extends HashMap<String,List<ValidationError>>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
static String |
GLOBAL_ERROR
Key that is used to store global (i.e.
|
| Constructor and Description |
|---|
ValidationErrors() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String field,
ValidationError error)
Synonym for put(String field, ValidationError error).
|
void |
addAll(String field,
List<ValidationError> errors)
Synonym for putAll().
|
void |
addGlobalError(ValidationError error)
Allows for the addition of errors that are not tied to a specific field.
|
boolean |
hasFieldErrors()
Returns true if there are field-specific errors present, and false if there are
only global errors, or no errors at all.
|
List<ValidationError> |
put(String field,
List<ValidationError> errors)
Replaces the list of errors for a given field with the list supplied.
|
void |
put(String field,
ValidationError error)
Adds an error message for the field specified.
|
void |
putAll(String field,
List<ValidationError> errors)
Add multiple errors for a particular field.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, valuesequals, hashCode, toStringpublic static final String GLOBAL_ERROR
public void put(String field, ValidationError error)
field - the name of the field in errorerror - a ValidationError to add to that fieldpublic void add(String field, ValidationError error)
field - the name of the field in errorerror - a ValidationError to add to that fieldpublic void putAll(String field, List<ValidationError> errors)
field - the name of the field in errorerrors - a non-null list of errors to add for the fieldpublic void addAll(String field, List<ValidationError> errors)
field - the name of the field in errorerrors - a non-null list of errors to add for the fieldpublic void addGlobalError(ValidationError error)
public List<ValidationError> put(String field, List<ValidationError> errors)
put in interface Map<String,List<ValidationError>>put in class HashMap<String,List<ValidationError>>field - the name of the field in errorerrors - the list of validation errors for the fieldpublic boolean hasFieldErrors()
© Copyright 2005-2006, Stripes Development Team.