Annotation Interface PatternConstraint


@Retention(RUNTIME) @Target({METHOD,TYPE_USE}) public @interface PatternConstraint
Constrains the values a configuration element of type String may take.

It is an error to annotate any type which is not a String.

The syntax used for the provided regular expression is defined in XML Schema Datatypes.

Note: to constrain the values of the strings in a List<String> or in a Optional<String>, annotate the type parameter as follows: List<@PatternConstraint("<expr>") String> or Optional<@PatternConstraint("<expr>") String>.

REC Note: Unlike some popular regular expression languages (including those defined by Perl and standard Unix utilities), the regular expression language defined here implicitly anchors all regular expressions at the head and tail, as the most common use of regular expressions in pattern is to match entire literals.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      the regular expression that should be used to validate the values the annotated element may take.