public class WhitespaceRule extends Object implements Rule
Modifier and Type | Field and Description |
---|---|
protected static char[] |
CHARS
Characters: TAB,LF,VT,FF,CR,Space.
|
static String |
ERROR_CODE
Error code for whitespace rule violation.
|
protected boolean |
reportAllFailures
Whether to report all whitespace matches or just the first.
|
Constructor and Description |
---|
WhitespaceRule()
Creates a new whitespace rule.
|
WhitespaceRule(char[] chars)
Creates a new whitespace rule.
|
WhitespaceRule(char[] chars,
boolean reportAll)
Creates a new whitespace rule.
|
WhitespaceRule(char[] chars,
MatchBehavior behavior)
Creates a new whitespace rule.
|
WhitespaceRule(char[] chars,
MatchBehavior behavior,
boolean reportAll)
Creates a new whitespace rule.
|
WhitespaceRule(MatchBehavior behavior)
Creates a new whitespace rule.
|
WhitespaceRule(MatchBehavior behavior,
boolean reportAll)
Creates a new whitespace rule.
|
Modifier and Type | Method and 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.
|
MatchBehavior |
getMatchBehavior()
Returns the match behavior for this rule.
|
char[] |
getWhitespaceCharacters()
Returns the whitespace characters for this rule.
|
String |
toString() |
RuleResult |
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
|
public static final String ERROR_CODE
protected static final char[] CHARS
protected boolean reportAllFailures
public WhitespaceRule()
public WhitespaceRule(MatchBehavior behavior)
behavior
- how to match whitespacepublic WhitespaceRule(char[] chars)
chars
- characters that are whitespacepublic WhitespaceRule(MatchBehavior behavior, boolean reportAll)
behavior
- how to match whitespacereportAll
- whether to report all matches or just the firstpublic WhitespaceRule(char[] chars, MatchBehavior behavior)
chars
- whitespace charactersbehavior
- how to match whitespacepublic WhitespaceRule(char[] chars, boolean reportAll)
chars
- whitespace charactersreportAll
- whether to report all matches or just the firstpublic WhitespaceRule(char[] chars, MatchBehavior behavior, boolean reportAll)
chars
- whitespace charactersbehavior
- how to match whitespacereportAll
- whether to report all matches or just the firstpublic char[] getWhitespaceCharacters()
public MatchBehavior getMatchBehavior()
public RuleResult validate(PasswordData passwordData)
Rule
protected Map<String,Object> createRuleResultDetailParameters(char c)
c
- whitespace characterprotected RuleResultMetadata createRuleResultMetadata(PasswordData password)
password
- data used for metadata creationCopyright © 2003-2024 Virginia Tech. All Rights Reserved.