Class FormErrors
java.lang.Object
org.ametys.plugins.forms.processing.FormErrors
Form errors.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
List<I18nizableText>> The errors as a Map of field ID -> error messages.protected Form
The corresponding form.protected boolean
True if the insertion has failedprotected boolean
True if the limit of entries is reached -
Constructor Summary
ConstructorDescriptionDefault constructor.FormErrors
(Form form, Map<String, List<I18nizableText>> errors) Constructor with parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(String fieldId, I18nizableText error) Add an error.void
addErrors
(String fieldId, List<I18nizableText> errors) Add an error list.Get the errors.getForm()
Get the form.boolean
Tests if the form has errors.boolean
True if the insertion has failedboolean
True if the entries limit has been reachedvoid
setErrors
(Map<String, List<I18nizableText>> errors) Set the errors.void
Set the form.void
setInsertionFailed
(boolean insertionFailed) Set if the insertion has failedvoid
setLimitReached
(boolean limitReached) Set if the entries limit has been reached
-
Field Details
-
_form
The corresponding form. -
_errors
The errors as a Map of field ID -> error messages. -
_insertionFailed
True if the insertion has failed -
_limitReached
True if the limit of entries is reached
-
-
Constructor Details
-
FormErrors
public FormErrors()Default constructor. -
FormErrors
Constructor with parameters.- Parameters:
form
- the Form object.errors
- the errors.
-
-
Method Details
-
getForm
Get the form.- Returns:
- the form
-
setForm
Set the form.- Parameters:
form
- the form to set
-
hasInsertionFailed
True if the insertion has failed- Returns:
true
if the insertion has failed
-
setInsertionFailed
Set if the insertion has failed- Parameters:
insertionFailed
- true if the insertion has failed
-
getErrors
Get the errors.- Returns:
- the errors
-
setErrors
Set the errors.- Parameters:
errors
- the errors to set
-
addError
Add an error.- Parameters:
fieldId
- the field ID.error
- the error message.
-
addErrors
Add an error list.- Parameters:
fieldId
- the field ID.errors
- the error messages.
-
hasErrors
Tests if the form has errors.- Returns:
- true if there are errors, false otherwise.
-
hasLimitReached
True if the entries limit has been reached- Returns:
true
if the entries limit has been reached
-
setLimitReached
Set if the entries limit has been reached- Parameters:
limitReached
- true if the entries limit has been reached
-