9 package javolution.xml.sax;
11 import java.io.FileInputStream;
12 import java.io.IOException;
13 import java.io.InputStream;
14 import java.io.Reader;
20 import org.xml.sax.DTDHandler;
21 import org.xml.sax.EntityResolver;
22 import org.xml.sax.ErrorHandler;
23 import org.xml.sax.InputSource;
24 import org.xml.sax.SAXException;
25 import org.xml.sax.SAXNotRecognizedException;
26 import org.xml.sax.SAXNotSupportedException;
90 public void parse(InputStream in)
throws IOException, SAXException {
97 throw new SAXException(e.getMessage());
114 public void parse(InputStream in, String encoding)
throws IOException,
122 throw new SAXException(e.getMessage());
140 public void parse(Reader reader)
throws IOException, SAXException {
147 throw new SAXException(e.getMessage());
154 public void parse(InputSource input)
throws IOException, SAXException {
155 Reader reader = input.getCharacterStream();
156 if (reader !=
null) {
159 InputStream inStream = input.getByteStream();
160 if (inStream !=
null) {
161 parse(inStream, input.getEncoding());
163 parse(input.getSystemId());
169 public void parse(String systemId)
throws IOException, SAXException {
170 InputStream inStream;
172 URL url =
new URL(systemId);
173 inStream = url.openStream();
176 inStream =
new FileInputStream(systemId);
178 throw new UnsupportedOperationException(
"Cannot parse "
187 if (handler !=
null) {
190 throw new NullPointerException();
201 if (handler !=
null) {
204 throw new NullPointerException();
214 public boolean getFeature(String name)
throws SAXNotRecognizedException,
215 SAXNotSupportedException {
216 if (name.equals(
"http://xml.org/sax/features/namespaces")) {
219 .equals(
"http://xml.org/sax/features/namespace-prefixes")) {
222 throw new SAXNotRecognizedException(
"Feature " + name
223 +
" not recognized");
228 throws SAXNotRecognizedException, SAXNotSupportedException {
229 if (name.equals(
"http://xml.org/sax/features/namespaces")
230 || name.equals(
"http://xml.org/sax/features/namespace-prefixes")) {
233 throw new SAXNotRecognizedException(
"Feature " + name
234 +
" not recognized");
238 public Object
getProperty(String name)
throws SAXNotRecognizedException,
239 SAXNotSupportedException {
240 throw new SAXNotRecognizedException(
"Property " + name
241 +
" not recognized");
245 throws SAXNotRecognizedException, SAXNotSupportedException {
246 throw new SAXNotRecognizedException(
"Property " + name
247 +
" not recognized");
288 throw new SAXException(
"Currently parsing");
291 boolean doContinue =
true;
293 CharArray uri, localName, qName, prefix, text;
300 prefix = (prefix ==
null) ?
NO_CHAR : prefix;
307 uri = (uri ==
null) ?
NO_CHAR : uri;
318 uri = (uri ==
null) ?
NO_CHAR : uri;
326 prefix = (prefix ==
null) ?
NO_CHAR : prefix;