com.ibm.passwordrules.standard
Class MustContain
java.lang.Object
|
+--com.ibm.passwordrules.LexicalRule
|
+--com.ibm.passwordrules.standard.MustContain
- All Implemented Interfaces:
- java.lang.Cloneable, Rule, java.io.Serializable
- public class MustContain
- extends LexicalRule
This class implements built-in rule for inclusion of required characters in a password
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_REQUIRED_CHARACTERS_FOUND
public static java.lang.String NO_REQUIRED_CHARACTERS_FOUND
INCOMPATIBLE_CHARACTER_RESTRICTIONS
public static java.lang.String INCOMPATIBLE_CHARACTER_RESTRICTIONS
MustContain
public MustContain(char[] charList)
MustContain
public MustContain(java.lang.String charList)
getCharList
public char[] getCharList()
setCharList
public void setCharList(char[] charList)
validate
public boolean validate(java.lang.String password,
ValidationInfo validationInfo)
throws InvalidPasswordException
- Validate the given password using the given validation info.
- Parameters:
validationInfo
- contains contextual information about the password being validated.password
- Password to validate.- Returns:
- true if password is valid
- Throws:
InvalidPasswordException
- thrown when password is invalid.
constrain
public void constrain(PasswordGenerator template)
- Constrain the generation template to values we know are valid.
- Overrides:
constrain
in class LexicalRule
- Parameters:
generator
- including a character template to be constrained.
join
public boolean join(Rule rule)
throws IncompatibleRulesException
- Try to join the specified rule with this one. The more restrictive
rule takes precedence.
- Parameters:
rule
- The rule to be joined with this one.rule
- The rule to be joined with this one.- Returns:
- True if the rule was successfully joined.
- Throws:
IncompatibleRulesException
- Thrown when given rule cannot be joined because it is not compatible.
Two must contain rules can only be joined if they have a non-null
intersection. If they do not, then they are incompatible.