Class BindingResultImpl

java.lang.Object
fr.paris.lutece.portal.util.mvc.binding.BindingResultImpl
All Implemented Interfaces:
BindingResult

@Vetoed public class BindingResultImpl extends Object implements 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 Details

    • BindingResultImpl

      public BindingResultImpl()
  • Method Details

    • isFailed

      public boolean isFailed()
      Returns true if there is at least one parameter error.
      Specified by:
      isFailed in interface BindingResult
      Returns:
      true if there is at least one parameter error
    • getAllMessages

      public List<String> 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:
      getAllMessages in interface BindingResult
      Returns:
      A list of human-readable messages
    • getAllErrors

      public Set<ParamError> getAllErrors()
      Returns an immutable set of all binding and validation errors.
      Specified by:
      getAllErrors in interface BindingResult
      Returns:
      All binding and validation errors.
    • getErrors

      public Set<ParamError> getErrors(String param)
      Returns an immutable set of all binding and validation errors for a specific parameter.
      Specified by:
      getErrors in interface BindingResult
      Parameters:
      param - parameter name
      Returns:
      All binding and validation errors for the parameter.
    • getBindingErrors

      public Set<BindingError> getBindingErrors()
      Returns an immutable set of all binding errors.
      Specified by:
      getBindingErrors in interface BindingResult
      Returns:
      All binding errors.
    • getValidationErrors

      public Set<ValidationError> getValidationErrors()
      Returns an immutable set of all validation errors.
      Specified by:
      getValidationErrors in interface BindingResult
      Returns:
      All validation errors.
    • addValidationErrors

      public void addValidationErrors(Set<ValidationError> validationErrors)
      Adds a binding error to the result.
    • addBindingError

      public void addBindingError(BindingError bindingError)
      Adds a single validation error to the result.
    • addBindingError

      public void addBindingError(List<BindingError> listbindingError)
      Adds a list of binding errors to the result.
    • hasUnconsumedErrors

      public boolean hasUnconsumedErrors()
      Check if has Unconsumed Errors