com.ibm.passwordrules
Class InvalidPasswordException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--com.ibm.passwordrules.InvalidPasswordException
- All Implemented Interfaces:
- java.io.Serializable
- public class InvalidPasswordException
- extends java.lang.Exception
Objects of this class are thrown when password violated one of the rules.
- See Also:
- Serialized Form
Constructor Summary |
InvalidPasswordException(Rule ruleViolated)
Construct an invalid password exception with the rule that was violated. |
InvalidPasswordException(Rule ruleViolated,
java.lang.String reason)
Construct an invalid password exception with the rule that was violated
and the reason for the violation. |
Method Summary |
java.lang.String |
getReason()
Gets the reason that the password violated the given rule. |
Rule |
getRuleViolated()
Returns the rule that was violated to generate this exception. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RULE_VIOLATION
public static java.lang.String RULE_VIOLATION
InvalidPasswordException
public InvalidPasswordException(Rule ruleViolated)
- Construct an invalid password exception with the rule that was violated.
- Parameters:
ruleViolated
- The rule the password violates.
InvalidPasswordException
public InvalidPasswordException(Rule ruleViolated,
java.lang.String reason)
- Construct an invalid password exception with the rule that was violated
and the reason for the violation.
- Parameters:
ruleViolated
- The rule the password violates.reason
- Reason for the violation.
getRuleViolated
public Rule getRuleViolated()
- Returns the rule that was violated to generate this exception.
- Returns:
- violated rule
getReason
public java.lang.String getReason()
- Gets the reason that the password violated the given rule. May be
an empty string indicating that no reason was given.
- Returns:
- reason for violation