Package org.ametys.core.userpref
Class UserPreferencesErrors
java.lang.Object
org.ametys.core.userpref.UserPreferencesErrors
User preferences errors.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
List<I18nizableText>> The errors as a Map of field ID -> error messages. -
Constructor Summary
ConstructorDescriptionDefault constructor.UserPreferencesErrors
(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.Get the errors for a single field.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
-
UserPreferencesErrors
public UserPreferencesErrors()Default constructor. -
UserPreferencesErrors
Constructor with parameters.- Parameters:
errors
- the errors.
-
-
Method Details
-
getErrors
Get the errors.- Returns:
- the errors.
-
getErrors
Get the errors for a single field.- Parameters:
fieldId
- the field ID.- Returns:
- the field 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.
-