public final class RegexRuleSet
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RegexRuleSet.Builder
Ruleset builder.
|
static class |
RegexRuleSet.Response
The two responses to an input.
|
static class |
RegexRuleSet.Rule
An individual rule in a ruleset.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.lang.String input)
Evaluate an input string against the ruleset for acceptance.
|
static RegexRuleSet |
buildBlacklist(java.util.regex.Pattern... patterns)
Factory method to build a whitelist ruleset.
|
static RegexRuleSet |
buildBlacklist(java.lang.String... patternStrings)
Factory method to build a whitelist ruleset.
|
static RegexRuleSet |
buildWhitelist(java.util.regex.Pattern... patterns)
Factory method to build a whitelist ruleset.
|
static RegexRuleSet |
buildWhitelist(java.lang.String... patternStrings)
Factory method to build a whitelist ruleset.
|
RegexRuleSet.Response |
evaluate(java.lang.String input)
Evaluate an input string against the rule set.
|
boolean |
reject(java.lang.String input)
Evaluate an input string against the ruleset for rejection.
|
public static RegexRuleSet buildWhitelist(java.lang.String... patternStrings)
patternStrings
- a set of pattern strings that constitute the whitelistpublic static RegexRuleSet buildWhitelist(java.util.regex.Pattern... patterns)
patterns
- a set of patterns that constitute the whitelistpublic static RegexRuleSet buildBlacklist(java.lang.String... patternStrings)
patternStrings
- a set of pattern strings that constitute the blacklistpublic static RegexRuleSet buildBlacklist(java.util.regex.Pattern... patterns)
patterns
- a set of patterns that constitute the blacklistpublic RegexRuleSet.Response evaluate(java.lang.String input)
input
- an input stringpublic boolean accept(java.lang.String input)
input
- an input stringpublic boolean reject(java.lang.String input)
input
- an input string