Class ValidPasswordValidator

  • All Implemented Interfaces:
    javax.validation.ConstraintValidator<ValidPassword,​java.lang.String>

    public class ValidPasswordValidator
    extends java.lang.Object
    implements javax.validation.ConstraintValidator<ValidPassword,​java.lang.String>
    Form validator that checks if the password supplied matches that of the current user
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initialize​(ValidPassword constraint)  
      boolean isValid​(java.lang.String password, javax.validation.ConstraintValidatorContext context)
      Performs the validation step by fetching the account from the repository, encoding the supplied password and checking that against the encoded password stored in the database
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValidPasswordValidator

        public ValidPasswordValidator()
    • Method Detail

      • initialize

        public void initialize​(ValidPassword constraint)
        Specified by:
        initialize in interface javax.validation.ConstraintValidator<ValidPassword,​java.lang.String>
      • isValid

        public boolean isValid​(java.lang.String password,
                               javax.validation.ConstraintValidatorContext context)
        Performs the validation step by fetching the account from the repository, encoding the supplied password and checking that against the encoded password stored in the database
        Specified by:
        isValid in interface javax.validation.ConstraintValidator<ValidPassword,​java.lang.String>
        Parameters:
        password - the plaintext password from the form
        context - (not used here)
        Returns:
        whether or not the validation passed