Package org.passay
Class IllegalRegexRule
- java.lang.Object
-
- org.passay.IllegalRegexRule
-
- All Implemented Interfaces:
Rule
- Direct Known Subclasses:
RepeatCharacterRegexRule
public class IllegalRegexRule extends Object implements Rule
Rule for determining if a password matches an illegal regular expression. Passwords which match the expression will fail validation.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for regex validation failures.protected Pattern
pattern
Regex pattern.protected boolean
reportAllFailures
Whether to report all sequence matches or just the first.
-
Constructor Summary
Constructors Constructor Description IllegalRegexRule(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
createRuleResultDetailParameters(String match)
Creates the parameter data for the rule result detail.Pattern
getPattern()
Returns the pattern for this rule.String
toString()
RuleResult
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
-
-
-
Field Detail
-
ERROR_CODE
public static final String ERROR_CODE
Error code for regex validation failures.- See Also:
- Constant Field Values
-
pattern
protected final Pattern pattern
Regex pattern.
-
reportAllFailures
protected boolean reportAllFailures
Whether to report all sequence matches or just the first.
-
-
Constructor Detail
-
IllegalRegexRule
public IllegalRegexRule(String regex)
Creates a new illegal regex rule.- Parameters:
regex
- regular expression
-
IllegalRegexRule
public IllegalRegexRule(String regex, int regexFlags)
Creates a new illegal regex rule.- Parameters:
regex
- regular expressionregexFlags
- regular expression flags
-
IllegalRegexRule
public IllegalRegexRule(String regex, boolean reportAll)
Creates a new illegal regex rule.- Parameters:
regex
- regular expressionreportAll
- whether to report all matches or just the first
-
IllegalRegexRule
public IllegalRegexRule(String regex, int regexFlags, boolean reportAll)
Creates a new illegal regex rule.- Parameters:
regex
- regular expressionregexFlags
- regular expression flagsreportAll
- whether to report all matches or just the first
-
-
Method Detail
-
getPattern
public Pattern getPattern()
Returns the pattern for this rule.- Returns:
- pattern
-
validate
public RuleResult validate(PasswordData passwordData)
Description copied from interface:Rule
Validates the supplied password data per the requirements of this rule.
-
createRuleResultDetailParameters
protected Map<String,Object> createRuleResultDetailParameters(String match)
Creates the parameter data for the rule result detail.- Parameters:
match
- matching regex- Returns:
- map of parameter name to value
-
-