public class ValidationErrors extends java.util.HashMap<java.lang.String,java.util.List<ValidationError>>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GLOBAL_ERROR
Key that is used to store global (i.e.
|
Constructor and Description |
---|
ValidationErrors() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String field,
ValidationError error)
Synonym for put(String field, ValidationError error).
|
void |
addAll(java.lang.String field,
java.util.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.
|
java.util.List<ValidationError> |
put(java.lang.String field,
java.util.List<ValidationError> errors)
Replaces the list of errors for a given field with the list supplied.
|
void |
put(java.lang.String field,
ValidationError error)
Adds an error message for the field specified.
|
void |
putAll(java.lang.String field,
java.util.List<ValidationError> errors)
Add multiple errors for a particular field.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values
public static final java.lang.String GLOBAL_ERROR
public void put(java.lang.String field, ValidationError error)
field
- the name of the field in errorerror
- a ValidationError to add to that fieldpublic void add(java.lang.String field, ValidationError error)
field
- the name of the field in errorerror
- a ValidationError to add to that fieldpublic void putAll(java.lang.String field, java.util.List<ValidationError> errors)
field
- the name of the field in errorerrors
- a non-null list of errors to add for the fieldpublic void addAll(java.lang.String field, java.util.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 java.util.List<ValidationError> put(java.lang.String field, java.util.List<ValidationError> errors)
put
in interface java.util.Map<java.lang.String,java.util.List<ValidationError>>
put
in class java.util.HashMap<java.lang.String,java.util.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.