Annotation Type Password
-
@Documented @Constraint(validatedBy=PasswordValidator.class) @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER}) @Retention(RUNTIME) public @interface Password
The annotated element must be a valid password.
Supported types are Strings, other Objects are transfered to Strings,nullelements are considered valid.
There are the following rules checked (withminRulesparameter the number rules can be defined that have to be fulfilled):- lowercase
- upercase
- digits
- special character
blacklistyou can give a comma separated list of words which are not allowed to be part of the password. Default is no entry.
UsingdisalowedStartCharsyou can define characters which are not allowed as first character in the password. Default is no entry.
WithmaxRepeatCharyou can limit the repeat of a single character, default is 0 which means no limitation.
size limits should be checked by separate size annotation.- Author:
- Manfred Tremmel
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description intminRulesminimum number rules that have to be fulfilled.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String[]blacklistArray of words which are not allowed as part of the password.String[]disalowedStartCharsCharacters which are not allowed at the beginning of a password.Class<?>[]groupsgroups to use.intmaxRepeatCharmaximum repeats of a single character.Stringmessagelocalized message.StringmessageBlacklistlocalized message if blacklisted.StringmessageMaxRepeatlocalized message if maximum repeat of a char is reached in a row.StringmessageStartCharacterslocalized message if start character is not allowed.Class<? extends javax.validation.Payload>[]payloadpayload whatever.
-
-
-
-
message
String message
localized message.- Returns:
- localized validation message
- Default:
- "{de.knightsoftnet.validators.shared.Password.message}"
-
-
-
messageBlacklist
String messageBlacklist
localized message if blacklisted.- Returns:
- error message for black listed passwords
- Default:
- "{de.knightsoftnet.validators.shared.PasswordBlacklist.message}"
-
-
-
messageStartCharacters
String messageStartCharacters
localized message if start character is not allowed.- Returns:
- error message for not allowed start characters
- Default:
- "{de.knightsoftnet.validators.shared.PasswordStartChar.message}"
-
-
-
messageMaxRepeat
String messageMaxRepeat
localized message if maximum repeat of a char is reached in a row.- Returns:
- error message for max repeat
- Default:
- "{de.knightsoftnet.validators.shared.PasswordMaxRepeat.message}"
-
-
-
groups
Class<?>[] groups
groups to use.- Returns:
- array of validation groups
- Default:
- {}
-
-
-
blacklist
String[] blacklist
Array of words which are not allowed as part of the password.- Returns:
- comma separated list of not allowed password
- Default:
- {}
-
-
-
disalowedStartChars
String[] disalowedStartChars
Characters which are not allowed at the beginning of a password.- Returns:
- characters which are not allowed
- Default:
- {}
-
-
-
payload
Class<? extends javax.validation.Payload>[] payload
payload whatever.- Returns:
- payload class
- Default:
- {}
-
-