KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > excalibur > xml > xpath > XPathException


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

17 package org.apache.excalibur.xml.xpath;
18
19 import java.io.PrintStream JavaDoc;
20 import java.io.PrintWriter JavaDoc;
21
22 import org.apache.avalon.framework.CascadingException;
23
24 /**
25  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
26  */

27 public class XPathException extends CascadingException {
28
29     /**
30      * Construct a new <code>ProcessingException</code> instance.
31      */

32     public XPathException(String JavaDoc message) {
33         super(message, null);
34     }
35     
36     /**
37      * Creates a new <code>ProcessingException</code> instance.
38      *
39      * @param ex an <code>Exception</code> value
40      */

41     public XPathException(Exception JavaDoc ex) {
42         super(ex.getMessage(), ex);
43     }
44     
45     /**
46      * Construct a new <code>ProcessingException</code> that references
47      * a parent Exception.
48      */

49     public XPathException(String JavaDoc message, Throwable JavaDoc t) {
50         super(message, t);
51     }
52     
53     public String JavaDoc toString() {
54         StringBuffer JavaDoc s = new StringBuffer JavaDoc();
55         s.append(super.toString());
56         final Throwable JavaDoc t = getCause();
57         if(t!=null) {
58             s.append(": ");
59             s.append(t.toString());
60         }
61         return s.toString();
62     }
63     
64     public void printStackTrace() {
65         super.printStackTrace();
66         if(getCause()!=null)
67             getCause().printStackTrace();
68     }
69     
70     public void printStackTrace( PrintStream JavaDoc s ) {
71         super.printStackTrace(s);
72         if(getCause()!=null)
73             getCause().printStackTrace(s);
74     }
75     
76     public void printStackTrace( PrintWriter JavaDoc s ) {
77         super.printStackTrace(s);
78         if(getCause()!=null)
79             getCause().printStackTrace(s);
80     }
81 }
82
Popular Tags