Enhance parser listener with title attributes for links.
[arachne.git] / src / net / pterodactylus / arachne / parser / ParserListener.java
1 /*
2  * © 2009 David ‘Bombe’ Roden
3  */
4 package net.pterodactylus.arachne.parser;
5
6 import java.io.InputStream;
7 import java.util.EventListener;
8
9 /**
10  * Interface for objects that need to be notified when a {@link Parser} finds
11  * indexable content.
12  *
13  * @author David ‘Bombe’ Roden <bombe@pterodactylus.net>
14  */
15 public interface ParserListener extends EventListener {
16
17         /**
18          * Notifies a listener that a title was identified in the parsed content.
19          *
20          * @param inputStream
21          *            The parsed input stream
22          * @param title
23          *            The title that was found
24          */
25         public void parsedTitle(InputStream inputStream, String title);
26
27         /**
28          * Notifies a listener that a link to a (maybe) different document was
29          * identified in the parsed content. The link may be in absolute or relative
30          * (to the URL of the streamed content) form.
31          *
32          * @param inputStream
33          *            The parsed input stream
34          * @param linkTarget
35          *            The target URL of the link
36          * @param linkTitle
37          *            The title attribute of the link
38          * @param linkText
39          *            The text of the link
40          */
41         public void parsedLink(InputStream inputStream, String linkTarget, String linkTitle, String linkText);
42
43 }