Add charset parameter to parse method.
[arachne.git] / src / net / pterodactylus / arachne / parser / Parser.java
1 /*
2  * © 2009 David ‘Bombe’ Roden
3  */
4 package net.pterodactylus.arachne.parser;
5
6 import java.io.IOException;
7 import java.io.InputStream;
8
9 /**
10  * Interface for a parser. A parser understands the format it should parse and
11  * can generate events based on the parsed content.
12  *
13  * @see ParserListener
14  * @author David ‘Bombe’ Roden <bombe@pterodactylus.net>
15  */
16 public interface Parser {
17
18         /**
19          * Parses the given input stream and sends events to the given listener.
20          *
21          * @param parserListener
22          *            The listener to send events to
23          * @param inputStream
24          *            The input stream to parse
25          * @param charset
26          *            The charset to use for parsing, or <code>null</code> if the
27          *            charset is unknown or the file is “binary” file, i.e. not
28          *            characters are read from it but bytes (e.g. image files)
29          * @throws IOException
30          *             if an I/O error occurs
31          */
32         public void parse(ParserListener parserListener, InputStream inputStream, String charset) throws IOException;
33
34 }