Package org.ametys.plugins.survey.answer
Class SurveyErrors
java.lang.Object
org.ametys.plugins.survey.answer.SurveyErrors
Survey errors.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
List<I18nizableText>> The errors as a Map of field ID -> error messages. -
Constructor Summary
ConstructorDescriptionDefault constructor.SurveyErrors
(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.boolean
Tests if the form has errors.void
setErrors
(Map<String, List<I18nizableText>> errors) Set the errors.
-
Field Details
-
_errors
The errors as a Map of field ID -> error messages.
-
-
Constructor Details
-
SurveyErrors
public SurveyErrors()Default constructor. -
SurveyErrors
Constructor with parameters.- Parameters:
errors
- the errors.
-
-
Method Details
-
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.
-