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