|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<String,List<ValidationError>>
net.sourceforge.stripes.validation.ValidationErrors
public class ValidationErrors
Container class for ValidationErrors that are tied to form fields. All of the regular Map methods are available and can be used. In addition there are a number of utility methods which are design to make it easier to interact with the data.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Field Summary | |
---|---|
static String |
GLOBAL_ERROR
Key that is used to store global (i.e. |
Constructor Summary | |
---|---|
ValidationErrors()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
public static final String GLOBAL_ERROR
Constructor Detail |
---|
public ValidationErrors()
Method Detail |
---|
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 field
public boolean hasFieldErrors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |