KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > xsl > XslParseException


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.xsl;
30
31 import com.caucho.util.LineCompileException;
32
33 import javax.xml.transform.TransformerConfigurationException JavaDoc;
34 import java.io.PrintStream JavaDoc;
35 import java.io.PrintWriter JavaDoc;
36
37 public class XslParseException extends TransformerConfigurationException JavaDoc
38   implements LineCompileException {
39   protected Throwable JavaDoc e;
40
41   public XslParseException()
42   {
43   }
44
45   public XslParseException(String JavaDoc msg)
46   {
47     super(msg);
48   }
49
50   public XslParseException(Throwable JavaDoc e)
51   {
52     super(e);
53
54     this.e = e;
55   }
56
57   public XslParseException(String JavaDoc msg, Throwable JavaDoc e)
58   {
59     super(msg, e);
60
61     this.e = e;
62   }
63
64   /**
65    * Hack for js.
66    */

67   public static XslParseException create(String JavaDoc msg)
68   {
69     return new XslParseException(msg);
70   }
71
72   public Throwable JavaDoc getCause()
73   {
74     return e;
75   }
76
77   public String JavaDoc getMessage()
78   {
79     if (e != null && e.getMessage() != null)
80       return e.getMessage();
81     else if (e != null)
82       return e.toString();
83     else
84       return super.getMessage();
85   }
86
87   public void printStackTrace()
88   {
89     if (e != null)
90       e.printStackTrace();
91     else
92       super.printStackTrace();
93   }
94
95   public void printStackTrace(PrintStream JavaDoc os)
96   {
97     if (e != null)
98       e.printStackTrace(os);
99     else
100       super.printStackTrace(os);
101   }
102
103   public void printStackTrace(PrintWriter JavaDoc pw)
104   {
105     if (e != null)
106       e.printStackTrace(pw);
107     else
108       super.printStackTrace(pw);
109   }
110
111   public String JavaDoc toString()
112   {
113     if (e != null)
114       return e.toString();
115     else
116       return super.toString();
117   }
118 }
119
Popular Tags