KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > jelly > util > SAXParseException


1 /*
2  * Copyright 2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.jelly.util;
17
18 import org.xml.sax.Locator JavaDoc;
19
20 /**
21  * <tt>SAXParseException</tt> with a bug fix to support
22  * exception nesting.
23  *
24  * @author Kohsuke Kawaguchi
25  */

26 public class SAXParseException extends org.xml.sax.SAXParseException JavaDoc {
27     public SAXParseException(String JavaDoc message, Locator JavaDoc locator) {
28         super(message, locator);
29     }
30
31     public SAXParseException(String JavaDoc message, Locator JavaDoc locator, Exception JavaDoc e) {
32         super(message, locator, e);
33     }
34
35     public SAXParseException(String JavaDoc message, String JavaDoc publicId, String JavaDoc systemId, int lineNumber, int columnNumber) {
36         super(message, publicId, systemId, lineNumber, columnNumber);
37     }
38
39     public SAXParseException(String JavaDoc message, String JavaDoc publicId, String JavaDoc systemId, int lineNumber, int columnNumber, Exception JavaDoc e) {
40         super(message, publicId, systemId, lineNumber, columnNumber, e);
41     }
42
43     // defining this method allows nested exception to be displayed on Java 1.4 and later
44
public Throwable JavaDoc getCause() {
45         return getException();
46     }
47
48     // show SAXParseException's message, as oppsoed to the message of the nested exception
49
public String JavaDoc toString() {
50         String JavaDoc s = getClass().getName();
51         String JavaDoc message = getLocalizedMessage();
52         return (message != null) ? (s + ": " + message) : s;
53     }
54 }
55
Popular Tags