Annotation Interface ValidateWith


@Target(PARAMETER) @Retention(CLASS) public @interface ValidateWith
Validates a parameter by invoking a custom validation method inside the command class. If the validation method throws an exception, it is caught and wrapped in a ValidationException.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the validation method inside the command class.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Custom message or translation key when validation fails.
  • Element Details

    • value

      String value
      The name of the validation method inside the command class.
      Returns:
      the validation method name
    • message

      String message
      Custom message or translation key when validation fails. Supports placeholders like %1$s for parameter name and %2$s for the thrown exception message.
      Returns:
      the error message or translation key
      Default:
      ""