|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException com.bankframe.localization.BankFrameRuntimeException
This class is the base class for all BankFrame exceptions. Instead of
using java.lang.String
for messages, it uses the
com.bankframe.localization.BankFrameMessage
class which
represents a localizable string. This class can be instantiated by
passing its constructor a BankFrameMessage or a sub-class of
java.lang.Throwable
. Using a sub-class of Throwable is termed
exception chaining. See the JDK 1.4 documentation for more information
on this topic. This class emulates the exception chaining functionality
provided in JDK1.4 so that exception chaining can be used on earlier JDKs.
Note that if the chained exception is not a sub-class of BankFrameException
it may not be possible to provide a fully localised message since only
BankFrameException sub-classes have support for per-user localisation.
Field Summary | |
static java.lang.String |
CHAINED_EXCEPTION_DIVIDER
|
static java.lang.String |
CHAINED_JAVA_EXCEPTION_MSG
|
static java.lang.String |
EXCEPTION_CLASS_NAME
|
static java.lang.String |
EXCEPTION_NAME
|
Constructor Summary | |
BankFrameRuntimeException(BankFrameMessage message)
Constructor. |
|
BankFrameRuntimeException(BankFrameMessage message,
java.lang.Throwable cause)
Constructor. |
|
BankFrameRuntimeException(java.lang.Throwable cause)
Constructor. |
Method Summary | |
BankFrameMessage |
getBankFrameMessage()
This method gets the BankFrameMessage object. |
java.lang.Throwable |
getCause()
This method gets the cause of this Exception, i.e the cause is the Throwable that caused this BankFrameRuntimeException to get thrown). |
java.lang.String |
getMessage()
This method gets the error message as a localized String. |
java.lang.String |
getMessage(java.util.Locale locale)
This method gets the error message as a localized String. |
java.lang.Throwable |
initCause(java.lang.Throwable cause)
Initializes the cause of this Throwable to the specified value. |
void |
printStackTrace()
This method prints this throwable and its backtrace to the standard error stream; |
void |
printStackTrace(java.io.PrintStream s)
This method prints this throwable and its backtrace to the standard error stream. |
void |
printStackTrace(java.io.PrintWriter s)
This method prints this throwable and its backtrace to the standard error stream. |
DataPacket |
toDataPacket()
This method converts the exception to a DataPacket. |
java.lang.String |
toString()
This method converts the exception to a String. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String EXCEPTION_CLASS_NAME
public static final java.lang.String EXCEPTION_NAME
public static final java.lang.String CHAINED_JAVA_EXCEPTION_MSG
public static final java.lang.String CHAINED_EXCEPTION_DIVIDER
Constructor Detail |
public BankFrameRuntimeException(BankFrameMessage message)
message
- the error message for the exceptionpublic BankFrameRuntimeException(BankFrameMessage message, java.lang.Throwable cause)
message
- the error message for the exceptioncause
- the original cause of this BankFrameException. This parameter must
not be null.public BankFrameRuntimeException(java.lang.Throwable cause)
cause
- the original cause of this BankFrameException. This parameter must
not be null.Method Detail |
public BankFrameMessage getBankFrameMessage()
public java.lang.Throwable getCause()
public java.lang.String getMessage()
getMessage(Locale locale)
instead.
public java.lang.String getMessage(java.util.Locale locale)
locale
- the locale to use for localizing the error message
public java.lang.Throwable initCause(java.lang.Throwable cause)
BankFrameRuntimeException(Throwable)
this method cannot be called even once. If this exception does not
have an associated BankFrameMessage before this method is called then this
method will use the BankFrameMessage from the cause.
cause
- The original cause of the BankFrameRuntimeException
public void printStackTrace()
public void printStackTrace(java.io.PrintStream s)
s
- the stream to print topublic void printStackTrace(java.io.PrintWriter s)
s
- The stream to print topublic DataPacket toDataPacket()
public java.lang.String toString()
getMessage(Locale locale)
to convert
the message to a localized String.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |