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