KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > javacoding > jspider > api > event > resource > ResourceReferenceDiscoveredEvent


1 package net.javacoding.jspider.api.event.resource;
2
3
4 import net.javacoding.jspider.api.event.EventVisitor;
5 import net.javacoding.jspider.api.model.FetchedResource;
6 import net.javacoding.jspider.api.model.Resource;
7
8
9 /**
10  *
11  * $Id: ResourceReferenceDiscoveredEvent.java,v 1.1.1.1 2002/11/20 17:02:32 vanrogu Exp $
12  *
13  * @author GŁnther Van Roey
14  */

15 public class ResourceReferenceDiscoveredEvent extends ResourceRelatedEvent {
16
17     protected Resource targetResource;
18
19     public ResourceReferenceDiscoveredEvent(Resource resource, Resource targetResource) {
20         super(resource);
21         this.targetResource = targetResource;
22     }
23
24     public FetchedResource getResource() {
25         return (FetchedResource) resource;
26     }
27
28     public Resource getReferencedResource() {
29         return targetResource;
30     }
31
32     public String JavaDoc getComment() {
33         return "resource " + resource + " references " + targetResource;
34     }
35
36     public void accept(EventVisitor visitor) {
37         visitor.visit(this);
38     }
39 }
40
Popular Tags