Package org.passay

Class PasswordValidator

  • All Implemented Interfaces:
    Rule

    public class PasswordValidator
    extends Object
    implements Rule
    The central component for evaluating multiple password rules against a candidate password.
    Author:
    Middleware Services
    • Method Detail

      • getRules

        public List<? extends Rule> getRules()
        Returns the password rules for this validator.
        Returns:
        unmodifiable list of password rules
      • getMessageResolver

        public MessageResolver getMessageResolver()
        Returns the message resolver for this validator.
        Returns:
        message resolver
      • validate

        public RuleResult validate​(PasswordData passwordData)
        Validates the supplied password data against the rules in this validator.
        Specified by:
        validate in interface Rule
        Parameters:
        passwordData - to validate
        Returns:
        rule result
      • getMessages

        public List<String> getMessages​(RuleResult result)
        Returns a list of human-readable messages by iterating over the details in a failed rule result.
        Parameters:
        result - failed rule result.
        Returns:
        list of human-readable messages describing the reason(s) for validation failure.