public abstract class AbstractDictionaryRule extends Object implements Rule
Constructor and Description |
---|
AbstractDictionaryRule() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
createRuleResultDetailParameters(String word)
Creates the parameter data for the rule result detail.
|
protected abstract String |
doWordSearch(String text)
Searches the dictionary with the supplied text.
|
Dictionary |
getDictionary()
Returns the dictionary used to search for passwords.
|
protected abstract String |
getErrorCode(boolean backwards)
Returns the error code for this rule.
|
boolean |
isMatchBackwards()
Returns true if the verify method will search the password for dictionary words spelled backwards as well as
forwards.
|
void |
setDictionary(Dictionary dict)
Sets the dictionary used to search for passwords.
|
void |
setMatchBackwards(boolean b)
This causes the verify method to search the password for dictionary words spelled backwards as well as forwards.
|
String |
toString() |
RuleResult |
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
|
public void setDictionary(Dictionary dict)
dict
- to use for searchingpublic Dictionary getDictionary()
public void setMatchBackwards(boolean b)
b
- whether to match dictionary words backwardspublic boolean isMatchBackwards()
public RuleResult validate(PasswordData passwordData)
Rule
protected Map<String,Object> createRuleResultDetailParameters(String word)
word
- matching wordprotected abstract String getErrorCode(boolean backwards)
backwards
- whether to return the error code for a backwards matchprotected abstract String doWordSearch(String text)
text
- to search dictionary withCopyright © 2003-2024 Virginia Tech. All Rights Reserved.