public class ExtNoSuchMethodException extends java.lang.NoSuchMethodException implements ThrowableList
ThrowableList
interface for the well-known JDK
NoSuchMethodException
.Constructor and Description |
---|
ExtNoSuchMethodException(java.lang.String msg)
This constructor takes a simple message string like ordinary Java
Throwable classes. |
ExtNoSuchMethodException(java.lang.String fmt,
java.lang.Object[] args)
This constructor takes a format string and its arguments.
|
ExtNoSuchMethodException(java.lang.Throwable trowable)
This constructor should be used for wrapping another
Throwable . |
ExtNoSuchMethodException(java.lang.Throwable throwable,
java.lang.String msg)
If one likes to add ones own information to a
Throwable ,
this constructor is the easiest way to do so. |
ExtNoSuchMethodException(java.lang.Throwable throwable,
java.lang.String fmt,
java.lang.Object[] args)
This is the most complex way to construct an
ThrowableList -
Throwable. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
getArguments()
Retrieving the arguments for message formats.
|
java.lang.Throwable |
getCause()
Retrieving the cause of a
Throwable . |
java.lang.String |
getFormat()
Getting the format string of a exception message.
|
java.lang.String |
getMessage()
Implementation of the standard
Throwable.getMessage() method. |
boolean |
isWrapper()
Check if
this is only a throwable that wraps the real one. |
java.lang.Throwable |
nextThrowable()
Deprecated.
use the JDK 1.4 call
getCause() instead |
public ExtNoSuchMethodException(java.lang.String msg)
Throwable
classes. This is the most convenient form to
construct an ThrowableList
throwable.msg
- message for this Throwable
instancepublic ExtNoSuchMethodException(java.lang.Throwable trowable)
Throwable
.
While reading data an IOException
may occur, but a certain interface
requires a SQLException
. Simply use:
try { ... } catch (NullPointerException ex) { throw new ExtNoSuchMethodException(ex); }
trowable
- the Throwable
to wrappublic ExtNoSuchMethodException(java.lang.Throwable throwable, java.lang.String msg)
Throwable
,
this constructor is the easiest way to do so. By using such an approach a
Throwable
trace with useful additional informations (which file
could not be found, what username is unknown) can be realized:
try { ... } catch (SQLException ex) { throw new IOException(ex, "while connecting to " + url); }
throwable
- the inner throwablemsg
- throwable messagepublic ExtNoSuchMethodException(java.lang.String fmt, java.lang.Object[] args)
MessageFormat
methods.
That means:
is similar tojava.text.Message.format(fmt, args)
new MyException(fmt, args).getMessage();
fmt
- throwable messageargs
- arguments for the given format stringpublic ExtNoSuchMethodException(java.lang.Throwable throwable, java.lang.String fmt, java.lang.Object[] args)
ThrowableList
-
Throwable. An inner Throwable
is accompanied by a format
string and its arguments.
throwable
- the inner throwablefmt
- throwable messageargs
- arguments for the given format stringpublic java.lang.Throwable getCause()
Throwable
. This is the method introduced
with JDK 1.4. It replaces the older nextThrowable()
.getCause
in interface ThrowableList
getCause
in class java.lang.Throwable
Throwable
Throwable.getCause()
public java.lang.Throwable nextThrowable()
getCause()
insteadThrowable
.
See ThrowableList.nextThrowable()
for details.nextThrowable
in interface ThrowableList
public boolean isWrapper()
this
is only a throwable that wraps the real one. See
ThrowableList.isWrapper()
for details.isWrapper
in interface ThrowableList
true
if this is a wrapper exception,
false
otherwisepublic java.lang.String getFormat()
getFormat
in interface ThrowableList
MessageFormat
getArguments()
public java.lang.Object[] getArguments()
MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
call.getArguments
in interface ThrowableList
getFormat()
public java.lang.String getMessage()
Throwable.getMessage()
method. It
delegates the call to the central ThrowableMessageFormatter.getMessage(de.susebox.java.lang.ThrowableList)
method.getMessage
in class java.lang.Throwable
ThrowableMessageFormatter