PasswordValidator

public interface PasswordValidator

Service interface that validates password

Methods

getName

String getName()

Returns the name of the validator used for retrieval. Must match the value from the configuration in order to be used.

Returns:the name of this validator

getValidationError

String getValidationError(Locale locale)

Returns the error message for the validator. Should explain what is expected of the password. The message should be treated as a literal, meaning localization is left to the validator implementation.

Parameters:
  • locale – the locale for which the error message should be returned
Returns:

the localized error message

validate

void validate(String password)

Validates password.

Parameters:
  • password – the password to check.
Throws: