Package org.passay

Class 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 Detail

      • 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,
                                boolean reportAll)
        Creates a new illegal regex rule.
        Parameters:
        regex - regular expression
        reportAll - 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.
        Specified by:
        validate in interface Rule
        Parameters:
        passwordData - to verify (not null).
        Returns:
        details on password verification
      • 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