Package org.ametys.plugins.survey.answer
Class SurveyErrors
- java.lang.Object
-
- org.ametys.plugins.survey.answer.SurveyErrors
-
public class SurveyErrors extends Object
Survey errors.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,List<I18nizableText>>
_errors
The errors as a Map of field ID -> error messages.
-
Constructor Summary
Constructors Constructor Description SurveyErrors()
Default constructor.SurveyErrors(Map<String,List<I18nizableText>> errors)
Constructor with parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.boolean
hasErrors()
Tests if the form has errors.void
setErrors(Map<String,List<I18nizableText>> errors)
Set the errors.
-
-
-
Field Detail
-
_errors
protected Map<String,List<I18nizableText>> _errors
The errors as a Map of field ID -> error messages.
-
-
Constructor Detail
-
SurveyErrors
public SurveyErrors()
Default constructor.
-
SurveyErrors
public SurveyErrors(Map<String,List<I18nizableText>> errors)
Constructor with parameters.- Parameters:
errors
- the errors.
-
-
Method Detail
-
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.
-
-