Package eu.webtoolkit.jwt
Class WPasswordValidator
java.lang.Object
eu.webtoolkit.jwt.WValidator
eu.webtoolkit.jwt.WRegExpValidator
eu.webtoolkit.jwt.WPasswordValidator
A validator that checks if a password is valid.
This validator validate an input like a browser supporting the attribute maxlength, minlength, required and pattern would.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WValidator
WValidator.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the message displayed when the password is too long.Returns the message displayed when the password is too small.Creates a Javascript object that validates the input.intReturns the maximum length of the password.intReturns the minimum length of the password.voidSets the message to display when the password is too long.voidSets the message to display when the password is too small.voidsetMaxLength(int chars) Specifies the maximum length of the password.voidsetMinLength(int chars) Specifies the minimum length of the password.Validates the given input.Methods inherited from class eu.webtoolkit.jwt.WRegExpValidator
getFlags, getInvalidNoMatchText, getRegExp, getRegExpPattern, setFlags, setInvalidNoMatchText, setRegExpMethods inherited from class eu.webtoolkit.jwt.WValidator
getFormat, getInputFilter, getInvalidBlankText, isMandatory, setInvalidBlankText, setMandatory
-
Constructor Details
-
WPasswordValidator
public WPasswordValidator()Creates a basic password validator.
-
-
Method Details
-
setMinLength
public void setMinLength(int chars) Specifies the minimum length of the password.The default value is 0.
-
getMinLength
public int getMinLength()Returns the minimum length of the password.- See Also:
-
setInvalidTooShortText
Sets the message to display when the password is too small.The default value is "Password too small".
-
getInvalidTooShortText
Returns the message displayed when the password is too small. -
setMaxLength
public void setMaxLength(int chars) Specifies the maximum length of the password.The default value is std::numeric_limits<int>::max().
-
getMaxLength
public int getMaxLength()Returns the maximum length of the password.- See Also:
-
setInvalidTooLongText
Sets the message to display when the password is too long.The default value is "Password too long".
-
getInvalidTooLongText
Returns the message displayed when the password is too long.- See Also:
-
validate
Description copied from class:WRegExpValidatorValidates the given input.The input is considered valid only when it is blank for a non-mandatory field, or matches the regular expression.
- Overrides:
validatein classWRegExpValidator
-
getJavaScriptValidate
Description copied from class:WValidatorCreates a Javascript object that validates the input.The JavaScript expression should evaluate to an object which contains a
validate(text)function, which returns an object that contains the following two fields:- fields: a boolean valid,
- a
messagethat indicates the problem if not valid.
Returns an empty string if the validator does not provide a client-side validation implementationq.
- Overrides:
getJavaScriptValidatein classWRegExpValidator- See Also:
-