Package org.passay.rule
Class AllowedRegexRule
java.lang.Object
org.passay.rule.AllowedRegexRule
- All Implemented Interfaces:
Rule
Rule for determining if a password matches an allowed regular expression. Passwords must match the expression or
validation will fail.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAllowedRegexRule(String regex) Creates a new allowed regex rule.AllowedRegexRule(String regex, int regexFlags) Creates a new allowed regex rule. -
Method Summary
Modifier and TypeMethodDescriptionCreates the parameter data for the rule result detail.Returns the pattern for this rule.toString()validate(PasswordData passwordData) Validates the supplied password data per the requirements of this rule.
-
Field Details
-
ERROR_CODE
Error code for regex validation failures.- See Also:
-
pattern
Regex pattern.
-
-
Constructor Details
-
AllowedRegexRule
Creates a new allowed regex rule.- Parameters:
regex- regular expression
-
AllowedRegexRule
Creates a new allowed regex rule.- Parameters:
regex- regular expressionregexFlags- regular expression flags
-
-
Method Details
-
getPattern
Returns the pattern for this rule.- Returns:
- pattern
-
validate
Description copied from interface:RuleValidates the supplied password data per the requirements of this rule. -
createRuleResultDetailParameters
Creates the parameter data for the rule result detail.- Returns:
- map of parameter name to value
-
toString
-