01: package com.jclark.xml.parse.awt;
02:
03: import java.io.IOException;
04: import java.awt.AWTException;
05: import com.jclark.xml.parse.*;
06:
07: /**
08: *
09: * @version $Revision: 1.1 $ $Date: 1998/05/08 06:38:54 $
10: */
11: public class ParserImpl extends ParserBase implements Parser {
12: private Application application = new ApplicationImpl();
13:
14: public void setApplication(Application application) {
15: if (application == null)
16: throw new NullPointerException();
17: this .application = application;
18: }
19:
20: /**
21: * Parses an XML document.
22: * If no <code>EntityManager</code> has been specified with
23: * <code>setEntityManager</code>, then <code>EntityManagerImpl</code>
24: * will be used.
25: *
26: * @param entity the document entity of the XML document
27: * @exception NotWellFormedException if the document is not well-formed
28: * @exception IOException if an IO error occurs
29: * @see EntityManagerImpl
30: */
31: public void parseDocument(OpenEntity entity) throws IOException,
32: AWTException {
33: try {
34: DocumentParser.parse(entity, entityManager, application,
35: locale);
36: } catch (ApplicationException e) {
37: throw (AWTException) e.getException();
38: }
39: }
40: }
|