|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.passwordrules.LexicalRule | +--com.ibm.passwordrules.standard.LengthConstraint
This class implements built-in rule for restricting the length of a password.
Field Summary | |
---|---|
static java.lang.String |
INCOMPATIBLE_LENGTH_RESTRICTIONS
Constant representing a message key in a property file |
static java.lang.String |
TOO_LONG
Constant representing a message key in a property file |
static java.lang.String |
TOO_SHORT
Constant representing a message key in a property file |
Fields inherited from class com.ibm.passwordrules.LexicalRule |
---|
DEFAULT_MAX_SEQUENTIAL_CHARACTERS, LOWER_CASE_ONLY, UPPER_CASE_ONLY |
Constructor Summary | |
---|---|
LengthConstraint()
Default constructor. |
|
LengthConstraint(int min,
int max)
The min must be smaller than max. |
Method Summary | |
---|---|
void |
constrain(PasswordGenerator generator)
Constrain the password generator to values we know are valid. |
int |
getMax()
Return maximum value of the length constraint. |
int |
getMin()
Return minimum length of the password. |
boolean |
join(Rule rule)
Try to join the specified rule with this one. |
boolean |
validate(java.lang.String password,
ValidationInfo validationInfo)
Validate the given password using the given validation info. |
Methods inherited from class com.ibm.passwordrules.LexicalRule |
---|
getParameter, setParameter, validateSafe |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String TOO_SHORT
public static final java.lang.String TOO_LONG
public static final java.lang.String INCOMPATIBLE_LENGTH_RESTRICTIONS
Constructor Detail |
public LengthConstraint()
public LengthConstraint(int min, int max)
min
- Minimum length of the password.max
- Maximum length of the password.Method Detail |
public int getMax()
public int getMin()
public void constrain(PasswordGenerator generator)
constrain
in interface Rule
constrain
in class LexicalRule
generator
- including a character generator to be constrained.
PasswordRulesRuntimeException
- when minimum length is greater than the maximum allowed.public boolean validate(java.lang.String password, ValidationInfo validationInfo) throws InvalidPasswordException
validationInfo
- contains contextual information about the password being validated.password
- Password to validate.
InvalidPasswordException
- thrown when password is invalid.public boolean join(Rule rule) throws IncompatibleRulesException
rule
- The rule to be joined with this one.
IncompatibleRulesException
- Thrown when given rule cannot be joined because it is not compatible.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |