Package org.passay

Class AllowedRegexRule

  • All Implemented Interfaces:
    Rule

    public class AllowedRegexRule
    extends Object
    implements Rule
    Rule for determining if a password matches an allowed regular expression. Passwords must match the expression or validation will fail.
    Author:
    Middleware Services
    • Field Detail

      • pattern

        protected final Pattern pattern
        Regex pattern.
    • Constructor Detail

      • AllowedRegexRule

        public AllowedRegexRule​(String regex)
        Creates a new allowed regex rule.
        Parameters:
        regex - regular expression
    • 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.
        Specified by:
        validate in interface Rule
        Parameters:
        passwordData - to verify (not null).
        Returns:
        details on password verification
      • createRuleResultDetailParameters

        protected Map<String,​Object> createRuleResultDetailParameters()
        Creates the parameter data for the rule result detail.
        Returns:
        map of parameter name to value