01: package com.sun.portal.rewriter.engines.xml.parser;
02:
03: import java.io.FileNotFoundException;
04: import java.io.IOException;
05: import java.io.Reader;
06: import java.net.MalformedURLException;
07:
08: /**
09: * XMLReader reads the data to be parsed.
10: *
11: */
12: public interface XMLReader {
13: public char read() throws IOException;
14:
15: public boolean atEOFOfCurrentStream() throws IOException;
16:
17: public boolean atEOF() throws IOException;
18:
19: public void unread(char ch) throws IOException;
20:
21: public int getLineNr();
22:
23: /**
24: * Opens a stream from a public and system ID.
25: */
26: public Reader openStream(String publicID, String systemID)
27: throws MalformedURLException, FileNotFoundException,
28: IOException;
29:
30: /**
31: * Starts a new stream from a Java reader. The new stream is used
32: * temporary to read data from. If that stream is exhausted, control
33: * returns to the "parent" stream.
34: */
35: public void startNewStream(Reader reader);
36:
37: /**
38: * Starts a new stream from a Java reader. The new stream is used
39: * temporary to read data from. If that stream is exhausted, control
40: * returns to the parent stream.
41: */
42: public void startNewStream(Reader reader, boolean isInternalEntity);
43:
44: /**
45: * Returns the current "level" of the stream on the stack of streams.
46: */
47: public int getStreamLevel();
48:
49: /**
50: * Sets the system ID of the current stream.
51: */
52: public void setSystemID(String systemID)
53: throws MalformedURLException;
54:
55: /**
56: * Sets the public ID of the current stream.
57: */
58: public void setPublicID(String publicID);
59:
60: /**
61: * Returns the current system ID.
62: */
63: public String getSystemID();
64:
65: }//interface XMLReader
|