01: package com.rimfaxe.xml.xmlreader;
02:
03: /** A source of XML that has been parsed.
04:
05: <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
06: This file is part of Sparta, an XML Parser, DOM, and XPath library.
07: This library is free software; you can redistribute it and/or
08: modify it under the terms of the GNU Lesser General Public License
09: as published by the Free Software Foundation; either version 2.1 of
10: the License, or (at your option) any later version. This library
11: is distributed in the hope that it will be useful, but WITHOUT ANY
12: WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: FITNESS FOR A PARTICULAR PURPOSE. </small></blockquote>
14: @see <a "href="doc-files/LGPL.txt">GNU Lesser General Public License</a>
15: @version $Date: 2002/08/19 05:03:57 $ $Revision: 1.1.1.1 $
16: @author Eamonn O'Brien-Strain
17: @author Sergio Marti
18: */
19: public interface ParseSource {
20:
21: String toString();
22:
23: String getSystemId();
24:
25: /** Last line number read by parser. */
26: int getLineNumber();
27:
28: ParseLog DEFAULT_LOG = new DefaultLog();
29:
30: }
31:
32: class DefaultLog implements ParseLog {
33:
34: public void error(String msg, String systemId, int line) {
35: System.err.println(systemId + "(" + line + "): " + msg
36: + " (ERROR)");
37: }
38:
39: public void warning(String msg, String systemId, int line) {
40: System.out.println(systemId + "(" + line + "): " + msg
41: + " (WARNING)");
42: }
43:
44: public void note(String msg, String systemId, int line) {
45: System.out.println(systemId + "(" + line + "): " + msg
46: + " (NOTE)");
47: }
48:
49: }
50:
51: // $Log: ParseSource.java,v $
52: // Revision 1.1.1.1 2002/08/19 05:03:57 eobrain
53: // import from HP Labs internal CVS
54: //
55: // Revision 1.10 2002/08/18 04:41:48 eob
56: // Add copyright and other formatting and commenting in preparation for
57: // release to SourceForge.
58: //
59: // Revision 1.9 2002/08/05 20:04:32 sermarti
60: //
61: // Revision 1.8 2002/07/25 21:10:15 sermarti
62: // Adding files that mysteriously weren't added from Sparta before.
63: //
64: // Revision 1.7 2002/02/01 21:58:04 eob
65: // To workaround javadoc bug, do not use anonymous class.
66: //
67: // Revision 1.6 2002/01/09 00:53:40 eob
68: // Add warning to default log.
69: //
70: // Revision 1.5 2002/01/08 19:52:34 eob
71: // Factored out ParseSource functionality into ParseCharStream and
72: // ParseByteStream.
73: //
74: // Revision 1.4 2002/01/05 21:29:15 eob
75: // Use PeekReader.
76: //
77: // Revision 1.3 2002/01/05 07:54:29 eob
78: // Proper handling of text interspersed between elements.
79: //
80: // Revision 1.2 2002/01/04 00:44:09 eob
81: // Improve logging.
82: //
83: // Revision 1.1 2002/01/04 17:09:14 eob
84: // initial
|