Package org.passay.rule
Class DictionaryRule
java.lang.Object
org.passay.rule.AbstractDictionaryRule
org.passay.rule.DictionaryRule
- All Implemented Interfaces:
Rule
Rule for determining if a password matches a dictionary word. This rule will optionally also check for reversed
words.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDictionaryRule(Dictionary dict) Creates a new dictionary rule.DictionaryRule(Dictionary dict, boolean matchBackwards) Creates a new dictionary rule. -
Method Summary
Modifier and TypeMethodDescriptionprotected CharSequencedoWordSearch(UnicodeString text) Searches the dictionary with the supplied text.protected StringgetErrorCode(boolean backwards) Returns the error code for this rule.Methods inherited from class org.passay.rule.AbstractDictionaryRule
createRuleResultDetailParameters, getDictionary, isMatchBackwards, toString, validate
-
Field Details
-
ERROR_CODE
Error code for matching dictionary word.- See Also:
-
ERROR_CODE_REVERSED
Error code for matching reversed dictionary word.- See Also:
-
-
Constructor Details
-
DictionaryRule
Creates a new dictionary rule. The dictionary should be ready to use when passed to this constructor.- Parameters:
dict- to use for searching
-
DictionaryRule
Creates a new dictionary rule. The dictionary should be ready to use when passed to this constructor.- Parameters:
dict- to use for searchingmatchBackwards- whether to match dictionary words backwards
-
-
Method Details
-
doWordSearch
Description copied from class:AbstractDictionaryRuleSearches the dictionary with the supplied text.- Specified by:
doWordSearchin classAbstractDictionaryRule- Parameters:
text- to search dictionary with- Returns:
- matching word
-
getErrorCode
Description copied from class:AbstractDictionaryRuleReturns the error code for this rule.- Specified by:
getErrorCodein classAbstractDictionaryRule- Parameters:
backwards- whether to return the error code for a backwards match- Returns:
- properties error code
-