public abstract class RegexRule extends Object
Modifier | Constructor and Description |
---|---|
protected |
RegexRule(boolean sign,
String regex)
Constructs a new regular expression rule.
|
protected |
RegexRule(boolean sign,
String regex,
String hostOrDomain)
Constructs a new regular expression rule.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept()
Return if this rule is used for filtering-in or out.
|
protected String |
hostOrDomain()
Return if this rule is used for filtering-in or out.
|
protected abstract boolean |
match(String url)
Checks if a url matches this rule.
|
protected String |
regex()
Return if this rule's regex.
|
protected RegexRule(boolean sign, String regex)
sign
- specifies if this rule must filter-in or filter-out. A
true
value means that any url matching this rule must
be accepted, a false
value means that any url
matching this rule must be rejected.regex
- is the regular expression used for matching (see
match(String)
method).protected RegexRule(boolean sign, String regex, String hostOrDomain)
sign
- specifies if this rule must filter-in or filter-out. A
true
value means that any url matching this rule must
be accepted, a false
value means that any url
matching this rule must be rejected.regex
- is the regular expression used for matching (see
match(String)
method).hostOrDomain
- the host or domain to which this regex belongsprotected boolean accept()
true
if any url matching this rule must be accepted,
otherwise false
.protected String hostOrDomain()
protected String regex()
protected abstract boolean match(String url)
url
- is the url to check.true
if the specified url matches this rule, otherwise
false
.Copyright © 2021 The Apache Software Foundation