KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > generator > SchemaException


1 /*
2  * Copyright 2003, 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  */

17 package org.apache.ws.jaxme.generator;
18
19 import java.io.PrintStream JavaDoc;
20 import java.io.PrintWriter JavaDoc;
21
22 /**
23  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
24  * @version $Id: SchemaException.java,v 1.2 2004/02/16 23:39:56 jochen Exp $
25  */

26 public class SchemaException extends Exception JavaDoc {
27   private Throwable JavaDoc inner;
28
29   public SchemaException(String JavaDoc pMsg) {
30      super(pMsg);
31   }
32
33   public SchemaException(Throwable JavaDoc pInner) {
34     inner = pInner;
35   }
36
37   public SchemaException(String JavaDoc pMsg, Throwable JavaDoc pInner) {
38     this(pMsg);
39     inner = pInner;
40   }
41
42   public Throwable JavaDoc getInner() {
43     return inner;
44   }
45
46   public void printStackTrace() {
47     super.printStackTrace();
48     if (inner != null) {
49       System.err.println("Root cause:");
50       inner.printStackTrace();
51     }
52   }
53
54   public void printStackTrace(PrintStream JavaDoc pStream) {
55     super.printStackTrace(pStream);
56     if (inner != null) {
57       pStream.println("Root cause:");
58       inner.printStackTrace(pStream);
59     }
60   }
61
62   public void printStackTrace(PrintWriter JavaDoc pWriter) {
63     super.printStackTrace(pWriter);
64     if (inner != null) {
65       pWriter.println("Root cause:");
66       inner.printStackTrace(pWriter);
67     }
68   }
69 }
70
Popular Tags