Package org.passay
Class IllegalCharacterRule
- java.lang.Object
-
- org.passay.IllegalCharacterRule
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for illegal character failures.protected boolean
reportAllFailures
Whether to report all sequence matches or just the first.
-
Constructor Summary
Constructors Constructor Description IllegalCharacterRule(char[] c)
Create a new illegal character rule.IllegalCharacterRule(char[] c, boolean reportAll)
Create a new illegal character rule.IllegalCharacterRule(char[] c, MatchBehavior behavior)
Create a new illegal character rule.IllegalCharacterRule(char[] c, MatchBehavior behavior, boolean reportAll)
Create a new illegal character rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
createRuleResultDetailParameters(char c)
Creates the parameter data for the rule result detail.protected RuleResultMetadata
createRuleResultMetadata(PasswordData password)
Creates the rule result metadata.char[]
getIllegalCharacters()
Returns the illegal characters for this rule.MatchBehavior
getMatchBehavior()
Returns the match behavior for this rule.String
toString()
RuleResult
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
-
-
-
Field Detail
-
ERROR_CODE
public static final String ERROR_CODE
Error code for illegal character failures.- See Also:
- Constant Field Values
-
reportAllFailures
protected boolean reportAllFailures
Whether to report all sequence matches or just the first.
-
-
Constructor Detail
-
IllegalCharacterRule
public IllegalCharacterRule(char[] c)
Create a new illegal character rule.- Parameters:
c
- illegal characters
-
IllegalCharacterRule
public IllegalCharacterRule(char[] c, MatchBehavior behavior)
Create a new illegal character rule.- Parameters:
c
- illegal charactersbehavior
- how to match illegal characters
-
IllegalCharacterRule
public IllegalCharacterRule(char[] c, boolean reportAll)
Create a new illegal character rule.- Parameters:
c
- illegal charactersreportAll
- whether to report all matches or just the first
-
IllegalCharacterRule
public IllegalCharacterRule(char[] c, MatchBehavior behavior, boolean reportAll)
Create a new illegal character rule.- Parameters:
c
- illegal charactersbehavior
- how to match illegal charactersreportAll
- whether to report all matches or just the first
-
-
Method Detail
-
getIllegalCharacters
public char[] getIllegalCharacters()
Returns the illegal characters for this rule.- Returns:
- illegal characters
-
getMatchBehavior
public MatchBehavior getMatchBehavior()
Returns the match behavior for this rule.- Returns:
- match behavior
-
validate
public RuleResult validate(PasswordData passwordData)
Description copied from interface:Rule
Validates the supplied password data per the requirements of this rule.
-
createRuleResultDetailParameters
protected Map<String,Object> createRuleResultDetailParameters(char c)
Creates the parameter data for the rule result detail.- Parameters:
c
- illegal character- Returns:
- map of parameter name to value
-
createRuleResultMetadata
protected RuleResultMetadata createRuleResultMetadata(PasswordData password)
Creates the rule result metadata.- Parameters:
password
- data used for metadata creation- Returns:
- rule result metadata
-
-