Annotation Type Pattern



  • @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
    @Retention(RUNTIME)
    @Repeatable(List.class)
    @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.

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String regexp  
    • Element Detail

      • regexp

        java.lang.String regexp
        Returns:
        the regular expression to match
      • flags

        Pattern.Flag[] flags
        Returns:
        array of Flags considered when resolving the regular expression
        Default:
        {}
      • message

        java.lang.String message
        Returns:
        the error message template
        Default:
        "{javax.validation.constraints.Pattern.message}"
      • groups

        java.lang.Class<?>[] groups
        Returns:
        the groups the constraint belongs to
        Default:
        {}
      • payload

        java.lang.Class<? extends Payload>[] payload
        Returns:
        the payload associated to the constraint
        Default:
        {}