javax.validation.constraints

## Annotation Type Pattern

-     @Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
      @Retention(value=RUNTIME)
      @Documented
      @Constraint(validatedBy={})
      public @interface Pattern

  The annotated `CharSequence` must match the specified regular expression. The regular expression follows the Java regular expression conventions see `Pattern`.

  Accepts `CharSequence`. `null` elements are considered valid.
  Author:
    Emmanuel Bernard

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `String` | `regexp`

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `Pattern.Flag[]` | `flags`
    `Class<?>[]` | `groups`
    `String` | `message`
    `Class<? extends Payload>[]` | `payload`

- - ### Element Detail

    - #### regexp

          public abstract String regexp

      Returns:
        the regular expression to match

    - #### flags

          public abstract Pattern.Flag[] flags

      Returns:
        array of `Flag`s considered when resolving the regular expression
      Default:
        {}

    - #### message

          public abstract String message

      Returns:
        the error message template
      Default:
        "{javax.validation.constraints.Pattern.message}"

    - #### groups

          public abstract Class<?>[] groups

      Returns:
        the groups the constraint belongs to
      Default:
        {}

    - #### payload

          public abstract Class<? extends Payload>[] payload

      Returns:
        the payload associated to the constraint
      Default:
        {}

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.