Class RegexRule
- java.lang.Object
-
- com.digitalpebble.stormcrawler.filtering.regex.RegexRule
-
public abstract class RegexRule extends Object
A generic regular expression rule. Borrowed from Apache Nutch 1.9.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
accept()
Return if this rule is used for filtering-in or out.protected abstract boolean
match(String url)
Checks if a url matches this rule.
-
-
-
Constructor Detail
-
RegexRule
protected RegexRule(boolean sign, String regex)
Constructs a new regular expression rule.- Parameters:
sign
- specifies if this rule must filter-in or filter-out. Atrue
value means that any url matching this rule must be accepted, afalse
value means that any url matching this rule must be rejected.regex
- is the regular expression used for matching (seematch(String)
method).
-
-
Method Detail
-
accept
protected boolean accept()
Return if this rule is used for filtering-in or out.- Returns:
true
if any url matching this rule must be accepted, otherwisefalse
.
-
match
protected abstract boolean match(String url)
Checks if a url matches this rule.- Parameters:
url
- is the url to check.- Returns:
true
if the specified url matches this rule, otherwisefalse
.
-
-