Class AbstractPasswordService.AbstractStrengthValidator
- Direct Known Subclasses:
PasswordStrengthValidator
- Enclosing interface:
- AbstractPasswordService
public abstract static class AbstractPasswordService.AbstractStrengthValidator extends WValidator
This class defines a specialized validator interface for evaluating password strength. The implementation allows to evaluate strength in addition to the normal validator functionality of validating a password.
The evaluateStrength()
computes the strength and returns
an instance of StrenghtValidatorResult which contains information on the validity and the
strength of the password together with possible messages.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WValidator
WValidator.Result, WValidator.State
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description AbstractStrengthValidator()
Constructor. -
Method Summary
Modifier and Type Method Description abstract AbstractPasswordService.StrengthValidatorResult
evaluateStrength(java.lang.String password, java.lang.String loginName, java.lang.String email)
Evaluates the strength of a password.WValidator.Result
validate(java.lang.String password)
Validates a password.WValidator.Result
validate(java.lang.String password, java.lang.String loginName, java.lang.String email)
Validates a password.Methods inherited from class eu.webtoolkit.jwt.WValidator
getFormat, getInputFilter, getInvalidBlankText, getJavaScriptValidate, isMandatory, setInvalidBlankText, setMandatory
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, remove, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AbstractStrengthValidator
public AbstractStrengthValidator()Constructor.
-
-
Method Details
-
evaluateStrength
public abstract AbstractPasswordService.StrengthValidatorResult evaluateStrength(java.lang.String password, java.lang.String loginName, java.lang.String email)Evaluates the strength of a password.The result is an instance of
AbstractPasswordService.StrengthValidatorResult
which contains information on the validity and the strength of the password together with possible messages.The validator may take into account the user's login name and email address, to exclude passwords that are too similar to these.
-
validate
public WValidator.Result validate(java.lang.String password, java.lang.String loginName, java.lang.String email)Validates a password.This uses
evaluateStrength()
, isValid() and message() to return the result of password validation. -
validate
Validates a password.Calls validate(password,
WString.Empty
, "");- Overrides:
validate
in classWValidator
-