Package org.passay
Class AllowedCharacterRule
- java.lang.Object
-
- org.passay.AllowedCharacterRule
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for allowed character failures.protected boolean
reportAllFailures
Whether to report all sequence matches or just the first.
-
Constructor Summary
Constructors Constructor Description AllowedCharacterRule(char[] c)
Create a new allowed character rule.AllowedCharacterRule(char[] c, boolean reportAll)
Create a new allowed character rule.AllowedCharacterRule(char[] c, MatchBehavior behavior)
Create a new allowed character rule.AllowedCharacterRule(char[] c, MatchBehavior behavior, boolean reportAll)
Create a new allowed 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[]
getAllowedCharacters()
Returns the allowed 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 allowed character failures.- See Also:
- Constant Field Values
-
reportAllFailures
protected boolean reportAllFailures
Whether to report all sequence matches or just the first.
-
-
Constructor Detail
-
AllowedCharacterRule
public AllowedCharacterRule(char[] c)
Create a new allowed character rule.- Parameters:
c
- allowed characters
-
AllowedCharacterRule
public AllowedCharacterRule(char[] c, MatchBehavior behavior)
Create a new allowed character rule.- Parameters:
c
- allowed charactersbehavior
- how to match allowed characters
-
AllowedCharacterRule
public AllowedCharacterRule(char[] c, boolean reportAll)
Create a new allowed character rule.- Parameters:
c
- allowed charactersreportAll
- whether to report all matches or just the first
-
AllowedCharacterRule
public AllowedCharacterRule(char[] c, MatchBehavior behavior, boolean reportAll)
Create a new allowed character rule.- Parameters:
c
- allowed charactersbehavior
- how to match allowed charactersreportAll
- whether to report all matches or just the first
-
-
Method Detail
-
getAllowedCharacters
public char[] getAllowedCharacters()
Returns the allowed characters for this rule.- Returns:
- allowed 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
-
-