--- /dev/null
+/*
+ * © 2009 David ‘Bombe’ Roden
+ */
+package net.pterodactylus.arachne.parser;
+
+import java.io.InputStream;
+
+/**
+ * Interface for a parser. A parser understands the format it should parse and
+ * can generate events based on the parsed content.
+ *
+ * @see ParserListener
+ * @author David ‘Bombe’ Roden <bombe@pterodactylus.net>
+ */
+public interface Parser {
+
+ /**
+ * Parses the given input stream and sends events to the given listener.
+ *
+ * @param parserListener
+ * The listener to send events to
+ * @param inputStream
+ * The input stream to parse
+ */
+ public void parse(ParserListener parserListener, InputStream inputStream);
+
+}
--- /dev/null
+/*
+ * © 2009 David ‘Bombe’ Roden
+ */
+package net.pterodactylus.arachne.parser;
+
+import java.io.InputStream;
+import java.util.EventListener;
+
+/**
+ * Interface for objects that need to be notified when a {@link Parser} finds
+ * indexable content.
+ *
+ * @author David ‘Bombe’ Roden <bombe@pterodactylus.net>
+ */
+public interface ParserListener extends EventListener {
+
+ /**
+ * Notifies a listener that a title was identified in the parsed content.
+ *
+ * @param inputStream
+ * The parsed input stream
+ * @param title
+ * The title that was found
+ */
+ public void parsedTitle(InputStream inputStream, String title);
+
+ /**
+ * Notifies a listener that a link to a (maybe) different document was
+ * identified in the parsed content. The link may be in absolute or relative
+ * (to the URL of the streamed content) form.
+ *
+ * @param inputStream
+ * The parsed input stream
+ * @param link
+ * The identified link
+ */
+ public void parsedLink(InputStream inputStream, String link);
+
+}