public class FormErrors extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<I18nizableText>> |
_errors
The errors as a Map of field ID -> error messages.
|
protected Form |
_form
The corresponding form.
|
protected boolean |
_insertionFailed
True if the insertion has failed
|
Constructor and Description |
---|
FormErrors()
Default constructor.
|
FormErrors(Form form,
Map<String,List<I18nizableText>> errors)
Constructor with parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addError(String fieldId,
I18nizableText error)
Add an error.
|
void |
addErrors(String fieldId,
List<I18nizableText> errors)
Add an error list.
|
Map<String,List<I18nizableText>> |
getErrors()
Get the errors.
|
Form |
getForm()
Get the form.
|
boolean |
hasErrors()
Tests if the form has errors.
|
boolean |
hasInsertionFailed()
True if the insertion has failed
|
void |
setErrors(Map<String,List<I18nizableText>> errors)
Set the errors.
|
void |
setForm(Form form)
Set the form.
|
void |
setInsertionFailed(boolean insertionFailed)
Set if the insertion has failed
|
protected Map<String,List<I18nizableText>> _errors
protected boolean _insertionFailed
public FormErrors()
public FormErrors(Form form, Map<String,List<I18nizableText>> errors)
form
- the Form object.errors
- the errors.public boolean hasInsertionFailed()
true
if the insertion has failedpublic void setInsertionFailed(boolean insertionFailed)
insertionFailed
- true if the insertion has failedpublic Map<String,List<I18nizableText>> getErrors()
public void setErrors(Map<String,List<I18nizableText>> errors)
errors
- the errors to setpublic void addError(String fieldId, I18nizableText error)
fieldId
- the field ID.error
- the error message.public void addErrors(String fieldId, List<I18nizableText> errors)
fieldId
- the field ID.errors
- the error messages.public boolean hasErrors()