Annotation Interface Mask


@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface Mask
Define format for the string in input.

Applies to String.

  • 'L': the user must enter an alphabetical letter from A ~ z.
  • '0': the user must enter a digit.
  • 'A': the user must enter an alphanumeric character.
  • '#': the user must enter a digit, blank space, '+' or '-'.
Also, can define the mask with special characters.

Example:

 @Mask("LL 000 AA")
 private String carPlate;
Author:
Chungyen Tsai
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Default:
      ""