KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > aelfred > SAXParserImpl


1 package com.icl.saxon.aelfred;
2
3 import javax.xml.parsers.*;
4 import org.xml.sax.*;
5
6 public class SAXParserImpl extends SAXParser {
7
8     private SAXDriver parser;
9     
10     public SAXParserImpl() {
11         parser = new SAXDriver();
12     }
13
14     public Parser getParser() throws SAXException {
15         throw new SAXException("The AElfred parser is a SAX2 XMLReader");
16     }
17     
18     public Object JavaDoc getProperty(String JavaDoc name)
19     throws SAXNotRecognizedException, SAXNotSupportedException {
20         return parser.getProperty(name);
21     }
22     
23     public XMLReader getXMLReader() {
24         return parser;
25     }
26     
27     public boolean isNamespaceAware() {
28         return true;
29     }
30     
31     public boolean isValidating() {
32         return false;
33     }
34     
35 /*
36     public void parse(File f, DefaultHandler handler)
37     throws IOException, SAXException {
38         setDefaultHandler(handler);
39         parseFile(f);
40     }
41     
42     public void parse(File f, HandlerBase handler)
43     throws IOException, SAXException {
44         setHandlerBase(handler);
45         parseFile(f);
46     }
47
48     public void parse(InputSource i, DefaultHandler handler)
49     throws IOException, SAXException {
50         setDefaultHandler(handler);
51         parser.parse(i);
52     }
53
54     public void parse(InputSource i, HandlerBase handler)
55     throws IOException, SAXException {
56         setHandlerBase(handler);
57         parser.parse(i);
58     }
59
60     public void parse(InputStream i, DefaultHandler handler)
61     throws IOException, SAXException {
62         setDefaultHandler(handler);
63         parser.parse(new InputSource(i));
64     }
65
66     public void parse(InputStream i, HandlerBase handler)
67     throws IOException, SAXException {
68         setHandlerBase(handler);
69         parser.parse(new InputSource(i));
70     }
71     
72     public void parse(InputStream i, DefaultHandler handler, String systemId)
73     throws IOException, SAXException {
74         setDefaultHandler(handler);
75         InputSource inp = new InputSource(i);
76         inp.setSystemId(systemId);
77         parser.parse(inp);
78     }
79
80     public void parse(InputStream i, HandlerBase handler, String systemId)
81     throws IOException, SAXException {
82         setHandlerBase(handler);
83         InputSource inp = new InputSource(i);
84         inp.setSystemId(systemId);
85         parser.parse(inp);
86     }
87
88     public void parse(String systemId, DefaultHandler handler)
89     throws IOException, SAXException {
90         setDefaultHandler(handler);
91         InputSource inp = new InputSource(systemId);
92         parser.parse(inp);
93     }
94
95     public void parse(String systemId, HandlerBase handler)
96     throws IOException, SAXException {
97         setHandlerBase(handler);
98         InputSource inp = new InputSource(systemId);
99         parser.parse(inp);
100     }
101 */

102
103     public void setProperty(String JavaDoc name, Object JavaDoc value)
104     throws SAXNotRecognizedException, SAXNotSupportedException {
105         parser.setProperty(name, value);
106     }
107 }
108
109 //
110
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
111
// you may not use this file except in compliance with the License. You may obtain a copy of the
112
// License at http://www.mozilla.org/MPL/
113
//
114
// Software distributed under the License is distributed on an "AS IS" basis,
115
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
116
// See the License for the specific language governing rights and limitations under the License.
117
//
118
// The Original Code is: all this file.
119
//
120
// The Initial Developer of the Original Code is
121
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
122
//
123
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
124
//
125
// Contributor(s): none.
126
//
127
Popular Tags