edu.vt.middleware.password
Class RegexRule

java.lang.Object
  extended by edu.vt.middleware.password.RegexRule
All Implemented Interfaces:
Rule
Direct Known Subclasses:
RepeatCharacterRegexRule

public class RegexRule
extends java.lang.Object
implements Rule

RegexRule contains methods for testing a regular expression to determine if a password is valid.

Version:
$Revision: 1841 $ $Date: 2011-02-25 14:05:47 -0500 (Fri, 25 Feb 2011) $
Author:
Middleware Services

Field Summary
protected  java.util.regex.Pattern pattern
          Regex pattern.
 
Constructor Summary
RegexRule(java.lang.String regex)
          This creates a new RegexRule with the supplied regular expression.
 
Method Summary
protected  java.lang.String getRuleResultDetail(java.util.regex.Matcher m)
          Returns the message to set on the rule result detail.
 java.lang.String toString()
          This returns a string representation of this object.
 RuleResult validate(PasswordData passwordData)
          This returns whether or not the supplied password data meets the requirements of this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pattern

protected final java.util.regex.Pattern pattern
Regex pattern.

Constructor Detail

RegexRule

public RegexRule(java.lang.String regex)
This creates a new RegexRule with the supplied regular expression.

Parameters:
regex - String regular expression
Method Detail

validate

public RuleResult validate(PasswordData passwordData)
This returns whether or not the supplied password data meets the requirements of this rule.

Specified by:
validate in interface Rule
Parameters:
passwordData - PasswordData to verify (not null).
Returns:
RuleResult - details on password verification

getRuleResultDetail

protected java.lang.String getRuleResultDetail(java.util.regex.Matcher m)
Returns the message to set on the rule result detail.

Parameters:
m - Matcher that found a match
Returns:
String result detail

toString

public java.lang.String toString()
This returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
String


Copyright © 2003-2011 Virginia Tech. All Rights Reserved.