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

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 java.lang.String ERROR_CODE
          Error code for regex validation failures.
protected  java.util.regex.Pattern pattern
          Regex pattern.
 
Constructor Summary
RegexRule(java.lang.String regex)
          Creates a new regex rule.
 
Method Summary
protected  java.util.Map<java.lang.String,?> createRuleResultDetailParameters(java.lang.String match)
          Creates the parameter data for the rule result detail.
 java.lang.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 java.lang.String ERROR_CODE
Error code for regex validation failures.

See Also:
Constant Field Values

pattern

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

Constructor Detail

RegexRule

public RegexRule(java.lang.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 java.util.Map<java.lang.String,?> createRuleResultDetailParameters(java.lang.String match)
Creates the parameter data for the rule result detail.

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

toString

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

Overrides:
toString in class java.lang.Object
Returns:
string representation


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