Annotation Type Regex


@Target(PARAMETER) @Retention(RUNTIME) public @interface Regex
Annotation version of adding RegexPreprocessor as a preprocessor using CommandArgument.addPreprocessor(BiFunction)
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    @NonNull String
    Regular expression pattern
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    @NonNull String
    Key for the caption used to generate the failure exception.
  • Element Details

    • value

      @NonNull String value
      Regular expression pattern
      Returns:
      Pattern
    • failureCaption

      @NonNull String failureCaption
      Key for the caption used to generate the failure exception. Defaults to StandardCaptionKeys.ARGUMENT_PARSE_FAILURE_REGEX
      Returns:
      Failure caption key
      Default:
      "argument.parse.failure.regex"