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 Object
implements Rule

Rule for determining if a password matches a regular expression.

Version:
$Revision: 1930 $ $Date: 2011-04-28 13:06:17 -0400 (Thu, 28 Apr 2011) $
Author:
Middleware Services

Field Summary
static String ERROR_CODE
          Error code for regex validation failures.
protected  Pattern pattern
          Regex pattern.
 
Constructor Summary
RegexRule(String regex)
          Creates a new regex rule.
 
Method Summary
protected  Map<String,?> createRuleResultDetailParameters(String match)
          Creates the parameter data for the rule result detail.
 String toString()
          Returns a string representation of this object.
 RuleResult validate(PasswordData passwordData)
          Validates the supplied password data per the requirements of this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_CODE

public static final String ERROR_CODE
Error code for regex validation failures.

See Also:
Constant Field Values

pattern

protected final Pattern pattern
Regex pattern.

Constructor Detail

RegexRule

public RegexRule(String regex)
Creates a new regex rule.

Parameters:
regex - regular expression
Method Detail

validate

public RuleResult validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.

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

createRuleResultDetailParameters

protected Map<String,?> createRuleResultDetailParameters(String match)
Creates the parameter data for the rule result detail.

Parameters:
match - matching regex
Returns:
map of parameter name to value

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
string representation


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