01: package com.jclark.xml.parse.io;
02:
03: import java.io.IOException;
04: import java.util.Locale;
05:
06: import com.jclark.xml.parse.*;
07:
08: /**
09: * An XML Parser.
10: * @see Application
11: * @see EntityManager
12: * @version $Revision: 1.1 $ $Date: 1998/05/08 06:38:36 $
13: */
14: public interface Parser {
15:
16: /**
17: * Sets the <code>EntityManager</code> which will be used
18: * to access external entities referenced in the document.
19: */
20: void setEntityManager(EntityManager entityManager);
21:
22: /**
23: * Sets the <code>Application</code>, which will receive information
24: * about the XML document.
25: */
26: void setApplication(Application application);
27:
28: /**
29: * Sets the locale to be used for error messages.
30: */
31: void setLocale(Locale locale);
32:
33: /**
34: * Parses an XML document. The current <code>EntityManager</code>,
35: * <code>Application</code> and <code>Locale</code> will be used
36: * for the entire parse. If no <code>EntityManager</code> has been
37: * set, a default <code>EntityManager</code> will be used.
38: * If no <code>Locale</code> has been set, the default <code>Locale</code>
39: * as returned by <code>Locale.getDefault</code> will be used.
40: * If no <code>Application</code> has been set, no information about
41: * the document will be reported, but an exception will be thrown if
42: * the document is not well-formed.
43: *
44: * @param entity the document entity of the XML document; the InputStream
45: * of the document entity will be closed after parsing
46: * @exception NotWellFormedException if the document is not well-formed
47: * @exception IOException if an IO error occurs or if a method in
48: * <code>Application</code> throws an <code>IOException</code>
49: */
50: void parseDocument(OpenEntity entity) throws IOException;
51: }
|