Class ValidationErrorImpl

java.lang.Object
fr.paris.lutece.portal.util.mvc.binding.validate.ValidationErrorImpl
All Implemented Interfaces:
ParamError, ValidationError

public class ValidationErrorImpl extends Object implements ValidationError
Represents a validation error that occurs during the validation process in the MVC framework. This class encapsulates details about the error, including the parameter name, the constraint violation, and a human-readable error message.
  • Constructor Details

    • ValidationErrorImpl

      public ValidationErrorImpl(jakarta.validation.ConstraintViolation<?> violation, String param, String message)
  • Method Details

    • getParamName

      public String getParamName()
      The parameter name of the value that caused the error. This is usually the name specified in the binding annotation.
      Specified by:
      getParamName in interface ParamError
      Returns:
      The name of the parameter which caused the error
    • getViolation

      public jakarta.validation.ConstraintViolation<?> getViolation()
      The underlying ConstraintViolation detected for the parameter.
      Specified by:
      getViolation in interface ValidationError
      Returns:
      The violation detected for the parameter
    • getMessage

      public String getMessage()
      Returns a human-readable error message for this error.
      Specified by:
      getMessage in interface ParamError
      Returns:
      The human-readable error message