Default validator and parameter description


Default validator and parameter description

@VCompare

Compare two parameter values, usage scenarios such as: new password and repeated new password two parameters Comparison of whether the values ​​are consistent;

cond: comparison condition, optional EQ and NOT_EQ, default is EQ;

with: parameter name to compare with;

withLabel: The parameter label name to compare with (the name used to display in the verification message), the default is empty;

msg: Custom verification message, the default is empty;

@VDateTime

Date type parameter verification;

pattern: date format string, the default is yyyy-MM-dd HH:mm:ss

msg: Custom verification message, empty by default;

@VEmail

Email address format verification;

msg: Custom verification message, default is empty;

@VLength

String length verification;

min: Set the minimum length, 0 means no limit;
max: Set the maximum length, 0 means no limit;
msg: Customize the verification message, the default is empty;

@VNumeric

Validation of numerical type parameters;

min: Set the minimum value, 0 means no limit;
max: Set the maximum value, 0 means no limit Limitations;
msg: Custom verification message, default is empty;

@VRegex

Regular expression verification;

regex: regular expression;

msg: custom verification message, default is empty;

@VRequried

Required Fill in the fields for verification;

msg: Custom verification message, default is empty;

Note:

  • The msg parameter in the above annotation can be the output message content or the key in the international resource file;
  • The validator is executed in the order of the annotation declaration, please be sure to pay attention! ! !