1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.archive.crawler.deciderules;
26
27
28 /***
29 * Rule applies configured decision to any URIs which do *not*
30 * match the supplied regexp.
31 *
32 * @author Kristinn Sigurdsson
33 */
34 public class NotMatchesListRegExpDecideRule extends MatchesListRegExpDecideRule {
35
36 private static final long serialVersionUID = 8691360087063555583L;
37
38
39
40
41
42 /***
43 * Usual constructor.
44 * @param name
45 */
46 public NotMatchesListRegExpDecideRule(String name) {
47 super(name);
48 setDescription("NotMatchesListRegExpDecideRule. Applies the configured " +
49 "decision to URIs *not* matching the supplied regular " +
50 "expressions. The list of regular expressions can be " +
51 "considered logically AND or OR. " +
52 "NOTE: This means that if there are no regular expressions in " +
53 "the list, this rule will apply to *all* URIs!");
54 }
55
56 /***
57 * Evaluate whether given object's string version does not match
58 * configured regexps (by reversing the superclass's answer).
59 *
60 * @param object Object to make decision about.
61 * @return true if the regexps are not matched
62 */
63 protected boolean evaluate(Object object) {
64 return ! super.evaluate(object);
65 }
66 }