Class FormErrors
- java.lang.Object
-
- org.ametys.plugins.forms.processing.FormErrors
-
public class FormErrors extends Object
Form errors.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,List<I18nizableText>>_errorsThe errors as a Map of field ID -> error messages.protected Form_formThe corresponding form.protected boolean_insertionFailedTrue if the insertion has failedprotected boolean_limitReachedTrue if the limit of entries is reached
-
Constructor Summary
Constructors Constructor Description FormErrors()Default constructor.FormErrors(Form form, Map<String,List<I18nizableText>> errors)Constructor with parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(String fieldId, I18nizableText error)Add an error.voidaddErrors(String fieldId, List<I18nizableText> errors)Add an error list.Map<String,List<I18nizableText>>getErrors()Get the errors.FormgetForm()Get the form.booleanhasErrors()Tests if the form has errors.booleanhasInsertionFailed()True if the insertion has failedbooleanhasLimitReached()True if the entries limit has been reachedvoidsetErrors(Map<String,List<I18nizableText>> errors)Set the errors.voidsetForm(Form form)Set the form.voidsetInsertionFailed(boolean insertionFailed)Set if the insertion has failedvoidsetLimitReached(boolean limitReached)Set if the entries limit has been reached
-
-
-
Field Detail
-
_errors
protected Map<String,List<I18nizableText>> _errors
The errors as a Map of field ID -> error messages.
-
_insertionFailed
protected boolean _insertionFailed
True if the insertion has failed
-
_limitReached
protected boolean _limitReached
True if the limit of entries is reached
-
-
Constructor Detail
-
FormErrors
public FormErrors()
Default constructor.
-
FormErrors
public FormErrors(Form form, Map<String,List<I18nizableText>> errors)
Constructor with parameters.- Parameters:
form- the Form object.errors- the errors.
-
-
Method Detail
-
hasInsertionFailed
public boolean hasInsertionFailed()
True if the insertion has failed- Returns:
trueif the insertion has failed
-
setInsertionFailed
public void setInsertionFailed(boolean insertionFailed)
Set if the insertion has failed- Parameters:
insertionFailed- true if the insertion has failed
-
getErrors
public Map<String,List<I18nizableText>> getErrors()
Get the errors.- Returns:
- the errors
-
setErrors
public void setErrors(Map<String,List<I18nizableText>> errors)
Set the errors.- Parameters:
errors- the errors to set
-
addError
public void addError(String fieldId, I18nizableText error)
Add an error.- Parameters:
fieldId- the field ID.error- the error message.
-
addErrors
public void addErrors(String fieldId, List<I18nizableText> errors)
Add an error list.- Parameters:
fieldId- the field ID.errors- the error messages.
-
hasErrors
public boolean hasErrors()
Tests if the form has errors.- Returns:
- true if there are errors, false otherwise.
-
hasLimitReached
public boolean hasLimitReached()
True if the entries limit has been reached- Returns:
trueif the entries limit has been reached
-
setLimitReached
public void setLimitReached(boolean limitReached)
Set if the entries limit has been reached- Parameters:
limitReached- true if the entries limit has been reached
-
-