Source Code Cross Referenced for SpellException.java in  » Mail-Clients » columba-1.4 » org » columba » mail » spellcheck » cswilly » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Mail Clients » columba 1.4 » org.columba.mail.spellcheck.cswilly 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Revision: 1.1 $
003:         * $Date: 2006/06/10 13:32:32 $
004:         * $Author: fdietz $
005:         *
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU General Public License
008:         * as published by the Free Software Foundation; either version 2
009:         * of the License, or any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
019:         */
020:        /*--
021:
022:         $Id: SpellException.java,v 1.1 2006/06/10 13:32:32 fdietz Exp $
023:
024:         Copyright (C) 2000 Brett McLaughlin & Jason Hunter.
025:         All rights reserved.
026:
027:         */
028:        package org.columba.mail.spellcheck.cswilly;
029:
030:        import java.io.PrintStream;
031:        import java.io.PrintWriter;
032:
033:        /**
034:         * <b><code>SpellException</code></b>
035:         * <p>
036:         * This <code>Exception</code> subclass is the top level
037:         *   <code>Exception</code> that spell classes
038:         *   can throw.  It's subclasses add specificity to the
039:         *   problems that can occur using spell, but this single
040:         *   <code>Exception</code> can be caught to handle all
041:         *   spell specific problems.
042:         * <p>
043:         * <b>This is a copy and paste of the JDOMException, create due.</b>
044:         * @author Brett McLaughlin
045:         * @author Jason Hunter
046:         * @version 1.0
047:         */
048:        public class SpellException extends Exception {
049:            /** A wrapped <code>Throwable</code> */
050:            protected Throwable rootCause;
051:
052:            /**
053:             * <p>
054:             * This will create an <code>Exception</code>.
055:             * </p>
056:             */
057:            public SpellException() {
058:                super ("Error occurred in spell application.");
059:            }
060:
061:            /**
062:             * <p>
063:             * This will create an <code>Exception</code> with the given message.
064:             * </p>
065:             *
066:             * @param message <code>String</code> message indicating
067:             *                the problem that occurred.
068:             */
069:            public SpellException(String message) {
070:                super (message);
071:            }
072:
073:            /**
074:             * <p>
075:             * This will create an <code>Exception</code> with the given message
076:             *   and wrap another <code>Exception</code>.  This is useful when
077:             *   the originating <code>Exception</code> should be held on to.
078:             * </p>
079:             *
080:             * @param message <code>String</code> message indicating
081:             *                the problem that occurred.
082:             * @param exception <code>Exception</code> that caused this
083:             *                  to be thrown.
084:             */
085:            public SpellException(String message, Throwable rootCause) {
086:                super (message);
087:                this .rootCause = rootCause;
088:            }
089:
090:            /**
091:             * <p>
092:             * This returns the message for the <code>Exception</code>. If
093:             *   there is a root cause, the message associated with the root
094:             *   <code>Exception</code> is appended.
095:             * </p>
096:             *
097:             * @return <code>String</code> - message for <code>Exception</code>.
098:             */
099:            public String getMessage() {
100:                if (rootCause != null) {
101:                    return super .getMessage() + ": " + rootCause.getMessage();
102:                } else {
103:                    return super .getMessage();
104:                }
105:            }
106:
107:            /**
108:             * <p>
109:             * This prints the stack trace of the <code>Exception</code>. If
110:             *   there is a root cause, the stack trace of the root
111:             *   <code>Exception</code> is printed right after.
112:             * </p>
113:             */
114:            public void printStackTrace() {
115:                super .printStackTrace();
116:
117:                if (rootCause != null) {
118:                    System.err.print("Root cause: ");
119:                    rootCause.printStackTrace();
120:                }
121:            }
122:
123:            /**
124:             * <p>
125:             * This prints the stack trace of the <code>Exception</code> to the given
126:             *   PrintStream. If there is a root cause, the stack trace of the root
127:             *   <code>Exception</code> is printed right after.
128:             * </p>
129:             */
130:            public void printStackTrace(PrintStream s) {
131:                super .printStackTrace(s);
132:
133:                if (rootCause != null) {
134:                    s.print("Root cause: ");
135:                    rootCause.printStackTrace(s);
136:                }
137:            }
138:
139:            /**
140:             * <p>
141:             * This prints the stack trace of the <code>Exception</code> to the given
142:             *   PrintWriter. If there is a root cause, the stack trace of the root
143:             *   <code>Exception</code> is printed right after.
144:             * </p>
145:             */
146:            public void printStackTrace(PrintWriter w) {
147:                super .printStackTrace(w);
148:
149:                if (rootCause != null) {
150:                    w.print("Root cause: ");
151:                    rootCause.printStackTrace(w);
152:                }
153:            }
154:
155:            /**
156:             * <p>
157:             * This will return the root cause <code>Throwable</code>, or null
158:             *   if one does not exist.
159:             * </p>
160:             *
161:             * @return <code>Throwable</code> - the wrapped <code>Throwable</code>.
162:             */
163:            public Throwable getRootCause() {
164:                return rootCause;
165:            }
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.