Package org.passay.rule
Class DictionarySubstringRule
java.lang.Object
org.passay.rule.AbstractDictionaryRule
org.passay.rule.DictionarySubstringRule
- All Implemented Interfaces:
Rule
Rule for determining if a password contains a dictionary word with optional checking for reversed words.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new dictionary substring rule.DictionarySubstringRule(Dictionary dict, boolean matchBackwards) Creates a new dictionary substring 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
-
DictionarySubstringRule
Creates a new dictionary substring rule. The dictionary should be ready to use when passed to this constructor.- Parameters:
dict- to use for searching
-
DictionarySubstringRule
Creates a new dictionary substring 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
-