2 * © 2009 David ‘Bombe’ Roden
4 package net.pterodactylus.arachne.parser;
6 import java.io.IOException;
7 import java.io.InputStream;
10 * Interface for a parser. A parser understands the format it should parse and
11 * can generate events based on the parsed content.
14 * @author David ‘Bombe’ Roden <bombe@pterodactylus.net>
16 public interface Parser {
19 * Parses the given input stream and sends events to the given listener.
21 * @param parserListener
22 * The listener to send events to
24 * The input stream to parse
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)
30 * if an I/O error occurs
32 public void parse(ParserListener parserListener, InputStream inputStream, String charset) throws IOException;