Package org.passay
Class AllowedRegexRule
- java.lang.Object
-
- org.passay.AllowedRegexRule
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for regex validation failures.protected Pattern
pattern
Regex pattern.
-
Constructor Summary
Constructors Constructor Description AllowedRegexRule(String regex)
Creates a new allowed regex rule.AllowedRegexRule(String regex, int regexFlags)
Creates a new allowed regex rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
createRuleResultDetailParameters()
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.
-
-
Constructor Detail
-
AllowedRegexRule
public AllowedRegexRule(String regex)
Creates a new allowed regex rule.- Parameters:
regex
- regular expression
-
AllowedRegexRule
public AllowedRegexRule(String regex, int regexFlags)
Creates a new allowed regex rule.- Parameters:
regex
- regular expressionregexFlags
- regular expression flags
-
-
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()
Creates the parameter data for the rule result detail.- Returns:
- map of parameter name to value
-
-