Package org.passay.rule
Class IllegalRegexRule
java.lang.Object
org.passay.rule.IllegalRegexRule
- All Implemented Interfaces:
Rule
Rule for determining if a password matches an illegal regular expression. Passwords which match the expression will
fail validation.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIllegalRegexRule(String regex) Creates a new illegal regex rule.IllegalRegexRule(String regex, boolean reportAll) Creates a new illegal regex rule.IllegalRegexRule(String regex, int regexFlags) Creates a new illegal regex rule.IllegalRegexRule(String regex, int regexFlags, boolean reportAll) Creates a new illegal regex rule. -
Method Summary
Modifier and TypeMethodDescriptionCreates the parameter data for the rule result detail.Returns the pattern for this rule.booleanReturns whether to report all matches or just the first.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. -
reportAllFailures
protected final boolean reportAllFailuresWhether to report all regex matches or just the first.
-
-
Constructor Details
-
IllegalRegexRule
Creates a new illegal regex rule.- Parameters:
regex- regular expression
-
IllegalRegexRule
Creates a new illegal regex rule.- Parameters:
regex- regular expressionregexFlags- regular expression flags
-
IllegalRegexRule
Creates a new illegal regex rule.- Parameters:
regex- regular expressionreportAll- whether to report all matches or just the first
-
IllegalRegexRule
Creates a new illegal regex rule.- Parameters:
regex- regular expressionregexFlags- regular expression flagsreportAll- whether to report all matches or just the first
-
-
Method Details
-
getReportAllFailures
public boolean getReportAllFailures()Returns whether to report all matches or just the first.- Returns:
- whether to report all matches or just the first
-
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.- Parameters:
match- matching regex- Returns:
- map of parameter name to value
-
toString
-