KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > javacoding > jspider > spi > Rule


1 package net.javacoding.jspider.spi;
2
3
4 import net.javacoding.jspider.api.model.Decision;
5 import net.javacoding.jspider.api.model.Site;
6 import net.javacoding.jspider.core.SpiderContext;
7
8 import java.net.URL JavaDoc;
9
10
11 /**
12  * Interface to be implemented upon each class that will act as a Decision-
13  * taking class.
14  * A group of Rule objects will together decide whether a certain URL is
15  * eligible for spidering and/or parsing in a given context.
16  *
17  * $Id: Rule.java,v 1.1 2003/04/03 16:25:22 vanrogu Exp $
18  *
19  * @author Günther Van Roey
20  */

21 public interface Rule {
22
23     /**
24      * Returns the name of the rule.
25      * @return the name of the rule
26      */

27     public String JavaDoc getName ( );
28
29     /**
30      * Applies the rule to the given URL.
31      * @param context the context we're spidering in
32      * @param currentSite the site we're currently spidering
33      * @param url the URL to be evaluated
34      * @return Decision object telling whether the URL is accepted for a
35      * specific purpose.
36      */

37     public Decision apply(SpiderContext context, Site currentSite, URL JavaDoc url);
38
39 }
40
Popular Tags