Class BindingResultImpl
java.lang.Object
fr.paris.lutece.portal.util.mvc.binding.BindingResultImpl
- All Implemented Interfaces:
BindingResult
Default implementation of the
BindingResult interface.
This class is used to collect and manage binding and validation errors
that occur during the processing of MVC requests in the Lutece framework.
It provides methods to check for errors, retrieve error messages, and access
detailed information about binding and validation errors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBindingError(BindingError bindingError) Adds a single validation error to the result.voidaddBindingError(List<BindingError> listbindingError) Adds a list of binding errors to the result.voidaddValidationErrors(Set<ValidationError> validationErrors) Adds a binding error to the result.Returns an immutable set of all binding and validation errors.Returns an immutable list of all messages representing both binding and validation errors.Returns an immutable set of all binding errors.Returns an immutable set of all binding and validation errors for a specific parameter.Returns an immutable set of all validation errors.booleanCheck if has Unconsumed ErrorsbooleanisFailed()Returnstrueif there is at least one parameter error.
-
Constructor Details
-
BindingResultImpl
public BindingResultImpl()
-
-
Method Details
-
isFailed
public boolean isFailed()Returnstrueif there is at least one parameter error.- Specified by:
isFailedin interfaceBindingResult- Returns:
trueif there is at least one parameter error
-
getAllMessages
Returns an immutable list of all messages representing both binding and validation errors. This method is a shortcut for:getAllErrors().stream().map(ParamError::getMessage).collect(Collectors.toList())
- Specified by:
getAllMessagesin interfaceBindingResult- Returns:
- A list of human-readable messages
-
getAllErrors
Returns an immutable set of all binding and validation errors.- Specified by:
getAllErrorsin interfaceBindingResult- Returns:
- All binding and validation errors.
-
getErrors
Returns an immutable set of all binding and validation errors for a specific parameter.- Specified by:
getErrorsin interfaceBindingResult- Parameters:
param- parameter name- Returns:
- All binding and validation errors for the parameter.
-
getBindingErrors
Returns an immutable set of all binding errors.- Specified by:
getBindingErrorsin interfaceBindingResult- Returns:
- All binding errors.
-
getValidationErrors
Returns an immutable set of all validation errors.- Specified by:
getValidationErrorsin interfaceBindingResult- Returns:
- All validation errors.
-
addValidationErrors
Adds a binding error to the result. -
addBindingError
Adds a single validation error to the result. -
addBindingError
Adds a list of binding errors to the result. -
hasUnconsumedErrors
public boolean hasUnconsumedErrors()Check if has Unconsumed Errors
-