public class TokenizerException extends java.lang.Exception implements ThrowableList
Wrapper exception for all the problems that may occur while parsing. There
are IOExceptions, SQLExceptions etc. that can all happen when a Tokenizer
tries to extract the next token.
The class supports formats and format arguments beside the usual plain throwable message string.
| Constructor and Description |
|---|
TokenizerException(java.lang.String msg)
This constructor takes a simple message string like ordinary Java
Throwable classes. |
TokenizerException(java.lang.String fmt,
java.lang.Object[] args)
This constructor takes a format string and its arguments.
|
TokenizerException(java.lang.Throwable ex)
This constructor should be used for wrapping another throwable.
|
TokenizerException(java.lang.Throwable ex,
java.lang.String msg)
If one likes to add ones own information to an throwable, this constructor is
the easiest way to do so.
|
TokenizerException(java.lang.Throwable ex,
java.lang.String fmt,
java.lang.Object[] args)
This is the most complex way to construct a
TokenizerException. |
| 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 throwable 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 TokenizerException(java.lang.String msg)
Throwable classes. This is the most convenient form to
construct an ThrowableList throwable.msg - message for this Throwable instancepublic TokenizerException(java.lang.Throwable ex)
Tokenizer interface requires a
TokenizerException. Simply use:
try {
...
} catch (IOException ex) {
throw new TokenizerException(ex);
}
ex - the throwable to wrappublic TokenizerException(java.lang.Throwable ex,
java.lang.String msg)
try {
...
} catch (IOException ex) {
throw new TokenizerException(ex, "while tokenizing " + path);
}
ex - the inner throwablemsg - throwable messagepublic TokenizerException(java.lang.String fmt,
java.lang.Object[] args)
MessageFormat methods.
That means:
java.text.Message.format(fmt, args)
is similar to
new TokenizerException(fmt, args).getMessage();
fmt - throwable messageargs - arguments for the given format stringpublic TokenizerException(java.lang.Throwable ex,
java.lang.String fmt,
java.lang.Object[] args)
TokenizerException.
An inner throwable is accompanied by a format string and its arguments.
Use this constructor in language-sensitive contexts or for formalized messages.
The meaning of the parameters is explained in the other constructors.ex - 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 ThrowableListgetCause in class java.lang.ThrowableThrowableThrowable.getCause()public java.lang.Throwable nextThrowable()
getCause() insteadThrowable.
See ThrowableList.nextThrowable() for details.nextThrowable in interface ThrowableListpublic boolean isWrapper()
this is only a throwable that wraps the real one. See
ThrowableList.isWrapper() for details.isWrapper in interface ThrowableListtrue if this is a wrapper throwable,
false otherwisepublic java.lang.String getFormat()
getFormat in interface ThrowableListMessageFormatgetArguments()public java.lang.Object[] getArguments()
MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) call.getArguments in interface ThrowableListgetFormat()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.ThrowableThrowableMessageFormatter