Package org.passay
Class DictionarySubstringRule
- java.lang.Object
-
- org.passay.AbstractDictionaryRule
-
- org.passay.DictionarySubstringRule
-
- All Implemented Interfaces:
Rule
public class DictionarySubstringRule extends AbstractDictionaryRule
Rule for determining if a password contains a dictionary word with optional checking for reversed words.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for matching dictionary word.static String
ERROR_CODE_REVERSED
Error code for matching reversed dictionary word.
-
Constructor Summary
Constructors Constructor Description DictionarySubstringRule()
Creates a new dictionary substring rule.DictionarySubstringRule(Dictionary dict)
Creates a new dictionary substring rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
doWordSearch(String text)
Searches the dictionary with the supplied text.protected String
getErrorCode(boolean backwards)
Returns the error code for this rule.-
Methods inherited from class org.passay.AbstractDictionaryRule
createRuleResultDetailParameters, getDictionary, isMatchBackwards, setDictionary, setMatchBackwards, toString, validate
-
-
-
-
Field Detail
-
ERROR_CODE
public static final String ERROR_CODE
Error code for matching dictionary word.- See Also:
- Constant Field Values
-
ERROR_CODE_REVERSED
public static final String ERROR_CODE_REVERSED
Error code for matching reversed dictionary word.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DictionarySubstringRule
public DictionarySubstringRule()
Creates a new dictionary substring rule. The dictionary should be set using theAbstractDictionaryRule.setDictionary(Dictionary)
method.
-
DictionarySubstringRule
public DictionarySubstringRule(Dictionary dict)
Creates a new dictionary substring rule. The dictionary should be ready to use when passed to this constructor.- Parameters:
dict
- to use for searching
-
-
Method Detail
-
doWordSearch
protected String doWordSearch(String text)
Description copied from class:AbstractDictionaryRule
Searches the dictionary with the supplied text.- Specified by:
doWordSearch
in classAbstractDictionaryRule
- Parameters:
text
- to search dictionary with- Returns:
- matching word
-
getErrorCode
protected String getErrorCode(boolean backwards)
Description copied from class:AbstractDictionaryRule
Returns the error code for this rule.- Specified by:
getErrorCode
in classAbstractDictionaryRule
- Parameters:
backwards
- whether to return the error code for a backwards match- Returns:
- properties error code
-
-