Annotation Interface URL


Constraint that validates that a character sequence is a URL.
Since:
5.1.0
  • Element Details

    • message

      String message
      Returns:
      The error message.
      Default:
      "must be a valid URL"
    • groups

      Class<?>[] groups
      Returns:
      The groups to apply.
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      Returns:
      The payload.
      Default:
      {}
    • protocol

      String protocol
      Returns:
      The required URL scheme, or an empty string to allow any scheme.
      Default:
      ""
    • host

      String host
      Returns:
      The required URL host, or an empty string to allow any host.
      Default:
      ""
    • port

      int port
      Returns:
      The required URL port, or -1 to allow any port.
      Default:
      -1
    • regexp

      String regexp
      Returns:
      An additional regular expression the URL must match.
      Default:
      ".*"
    • flags

      jakarta.validation.constraints.Pattern.Flag[] flags
      Returns:
      The flags used with regexp().
      Default:
      {}