KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > XDocletException


1 /*
2  * Copyright (c) 2001, 2002 The XDoclet team
3  * All rights reserved.
4  */

5 package xdoclet;
6
7 import java.io.ByteArrayOutputStream JavaDoc;
8 import java.io.IOException JavaDoc;
9 import java.io.PrintWriter JavaDoc;
10
11 import xdoclet.template.TemplateException;
12
13 /**
14  * @author Ara Abrahamian (ara_e@email.com)
15  * @created Oct 14, 2001
16  * @version $Revision: 1.7 $
17  */

18 public class XDocletException extends TemplateException
19 {
20     /**
21      * Describe what the XDocletException constructor does
22      *
23      * @param msg Describe what the parameter does
24      */

25     public XDocletException(String JavaDoc msg)
26     {
27         this(null, msg);
28     }
29
30     /**
31      * Describe what the XDocletException constructor does
32      *
33      * @param nestedException Describe what the parameter does
34      * @param msg Describe what the parameter does
35      */

36     public XDocletException(Exception JavaDoc nestedException, String JavaDoc msg)
37     {
38         super(nestedException, msg);
39     }
40
41     /**
42      * Gets the PrintStackTrace attribute of the XDocletException object
43      *
44      * @return The PrintStackTrace value
45      */

46     public String JavaDoc getPrintStackTrace()
47     {
48         try {
49             ByteArrayOutputStream JavaDoc baos = new ByteArrayOutputStream JavaDoc();
50             PrintWriter JavaDoc writer = new PrintWriter JavaDoc(baos);
51
52             super.printStackTrace(writer);
53             baos.close();
54             writer.close();
55
56             return new String JavaDoc(baos.toByteArray());
57         }
58         catch (IOException JavaDoc e) {
59             e.printStackTrace();
60             return null;
61         }
62     }
63 }
64
65
Popular Tags