Source Code Cross Referenced for ExtNoSuchMethodException.java in  » Parser » JTopas » de » susebox » java » lang » 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 » Parser » JTopas » de.susebox.java.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ExtNoSuchMethodException.java: Extended standard throwable for stacks
003:         *
004:         * Copyright (C) 2001 Heiko Blau
005:         *
006:         * This file belongs to the Susebox Java Core Library (Susebox JCL).
007:         * The Susebox JCL is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU Lesser General Public License as published by the
009:         * Free Software Foundation; either version 2.1 of the License, or (at your
010:         * option) any later version.
011:         *
012:         * This software is distributed in the hope that it will be useful, but WITHOUT
013:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
014:         * FITNESS FOR A PARTICULAR PURPOSE.
015:         * See the GNU Lesser General Public License for more details.
016:         *
017:         * You should have received a copy of the GNU Lesser General Public License along
018:         * with the Susebox JCL. If not, write to the
019:         *
020:         *   Free Software Foundation, Inc.
021:         *   59 Temple Place, Suite 330,
022:         *   Boston, MA 02111-1307
023:         *   USA
024:         *
025:         * or check the Internet: http://www.fsf.org
026:         *
027:         * Contact:
028:         *   email: heiko@susebox.de
029:         */
030:
031:        package de.susebox.java.lang;
032:
033:        //------------------------------------------------------------------------------
034:        // Imports
035:        //
036:        import java.lang.NoSuchMethodException;
037:
038:        //------------------------------------------------------------------------------
039:        // ExtNoSuchMethodException - definition
040:        //
041:
042:        /**
043:         * Implementation of the {@link ThrowableList} interface for the well-known JDK 
044:         * {@link java.lang.NoSuchMethodException}.
045:         *
046:         * @author 	Heiko Blau
047:         */
048:        public class ExtNoSuchMethodException extends NoSuchMethodException
049:                implements  ThrowableList {
050:            //---------------------------------------------------------------------------
051:            // methods of the ThrowableList interface
052:            //
053:
054:            /**
055:             * Retrieving the cause of a <code>Throwable</code>. This is the method introduced
056:             * with JDK 1.4. It replaces the older {@link #nextThrowable}.
057:             *
058:             * @return the cause of this <code>Throwable</code>
059:             * @see java.lang.Throwable#getCause
060:             */
061:            public Throwable getCause() {
062:                return _next;
063:            }
064:
065:            /**
066:             * Method to traverse the list of {@link java.lang.Throwable}. 
067:             * See {@link ThrowableList#nextThrowable} for details.
068:             *
069:             * @return the "earlier" throwable
070:             * @deprecated use the JDK 1.4 call {@link #getCause} instead
071:             */
072:            public Throwable nextThrowable() {
073:                return getCause();
074:            }
075:
076:            /**
077:             * Check if <code>this</code> is only a throwable that wraps the real one. See 
078:             * {@link ThrowableList#isWrapper} for details.
079:             *
080:             * @return <code>true</code> if this is a wrapper exception,
081:             *         <code>false</code> otherwise
082:             */
083:            public boolean isWrapper() {
084:                return _isWrapper;
085:            }
086:
087:            /**
088:             * Getting the format string of a exception message. This can also be the 
089:             * message itself if there are no arguments.
090:             *
091:             * @return  the format string being used by {@link java.text.MessageFormat}
092:             * @see     #getArguments
093:             */
094:            public String getFormat() {
095:                return super .getMessage();
096:            }
097:
098:            /**
099:             * Retrieving the arguments for message formats. These arguments are used by
100:             * the {@link java.text.MessageFormat#format} call.
101:             *
102:             * @return  the arguments for a message format
103:             * @see     #getFormat
104:             */
105:            public Object[] getArguments() {
106:                return _args;
107:            }
108:
109:            //---------------------------------------------------------------------------
110:            // constructors
111:            //
112:
113:            /**
114:             * This constructor takes a simple message string like ordinary Java 
115:             * {@link java.lang.Throwable} classes. This is the most convenient form to 
116:             * construct an <code>ThrowableList</code> throwable.
117:             *
118:             * @param msg   message for this <code>Throwable</code> instance
119:             */
120:            public ExtNoSuchMethodException(String msg) {
121:                this (null, msg, null);
122:            }
123:
124:            /**
125:             * This constructor should be used for wrapping another {@link java.lang.Throwable}. 
126:             * While reading data an <code>IOException</code> may occur, but a certain interface 
127:             * requires a <code>SQLException</code>. Simply use:
128:             *<blockquote><pre>
129:             * try {
130:             *   ...
131:             * } catch (NullPointerException ex) {
132:             *   throw new ExtNoSuchMethodException(ex);
133:             * }
134:             *</pre></blockquote>
135:             *
136:             * @param trowable  the <code>Throwable</code> to wrap
137:             */
138:            public ExtNoSuchMethodException(Throwable trowable) {
139:                this (trowable, null, null);
140:            }
141:
142:            /**
143:             * If one likes to add ones own information to a {@link java.lang.Throwable}, 
144:             * this constructor is the easiest way to do so. By using such an approach a 
145:             * <code>Throwable</code> trace with useful additional informations (which file 
146:             * could not be found, what username is unknown) can be realized:
147:             *<blockquote><pre>
148:             * try {
149:             *   ...
150:             * } catch (SQLException ex) {
151:             *   throw new IOException(ex, "while connecting to " + url);
152:             * }
153:             *</pre></blockquote>
154:             *
155:             * @param throwable the inner throwable
156:             * @param msg       throwable message
157:             */
158:            public ExtNoSuchMethodException(Throwable throwable, String msg) {
159:                this (throwable, msg, null);
160:            }
161:
162:            /**
163:             * This constructor takes a format string and its arguments. The format string
164:             * must have a form that can be used by {@link java.text.MessageFormat} methods.
165:             * That means:
166:             *<blockquote><pre>
167:             *    java.text.Message.format(fmt, args)
168:             *</pre></blockquote>
169:             * is similar to
170:             *<blockquote><pre>
171:             *    new MyException(fmt, args).getMessage();
172:             *</pre></blockquote>
173:             *
174:             * @param fmt   throwable message
175:             * @param args  arguments for the given format string
176:             */
177:            public ExtNoSuchMethodException(String fmt, Object[] args) {
178:                this (null, fmt, args);
179:            }
180:
181:            /**
182:             * This is the most complex way to construct an <code>ThrowableList</code>-
183:             * Throwable. An inner {@link java.lang.Throwable} is accompanied by a format 
184:             * string and its arguments.
185:             *<br>
186:             * Use this constructor in language-sensitive contexts or for formalized messages.
187:             * The meaning of the parameters is explained in the other constructors.
188:             *
189:             * @param throwable the inner throwable
190:             * @param fmt       throwable message
191:             * @param args      arguments for the given format string
192:             */
193:            public ExtNoSuchMethodException(Throwable throwable, String fmt,
194:                    Object[] args) {
195:                super (fmt);
196:
197:                if (throwable != null && fmt == null) {
198:                    _isWrapper = true;
199:                } else {
200:                    _isWrapper = false;
201:                }
202:                _next = throwable;
203:                _args = args;
204:            }
205:
206:            //---------------------------------------------------------------------------
207:            // overridden methods
208:            //
209:
210:            /**
211:             * Implementation of the standard {@link java.lang.Throwable#getMessage} method. It
212:             * delegates the call to the central {@link ThrowableMessageFormatter#getMessage}
213:             * method.
214:             *
215:             * @return  the formatted throwable message
216:             * @see     ThrowableMessageFormatter
217:             */
218:            public String getMessage() {
219:                return ThrowableMessageFormatter.getMessage(this );
220:            }
221:
222:            //---------------------------------------------------------------------------
223:            // members
224:            //
225:
226:            /**
227:             * the parameters to be used when formatting the throwable message
228:             */
229:            protected Object[] _args = null;
230:
231:            /**
232:             * The wrapped, nested of next throwable.
233:             */
234:            protected Throwable _next = null;
235:
236:            /**
237:             * If <code>true</code> this is only a wrapper throwable with the real one
238:             * being returned by {@link #nextThrowable}, <code>false</code> for standalone, 
239:             * nested or subsequent exceptions
240:             */
241:            protected boolean _isWrapper = false;
242:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.