|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.bankframe.localization.BankFrameRuntimeException
public class 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 String |
CHAINED_EXCEPTION_DIVIDER
|
static String |
CHAINED_JAVA_EXCEPTION_MSG
|
static String |
EXCEPTION_CLASS_NAME
|
static String |
EXCEPTION_NAME
|
| Constructor Summary | |
|---|---|
BankFrameRuntimeException(BankFrameMessage message)
Constructor. |
|
BankFrameRuntimeException(BankFrameMessage message,
Throwable cause)
Constructor. |
|
BankFrameRuntimeException(Throwable cause)
Constructor. |
|
| Method Summary | |
|---|---|
BankFrameMessage |
getBankFrameMessage()
This method gets the BankFrameMessage object. |
Throwable |
getCause()
This method gets the cause of this Exception, i.e the cause is the Throwable that caused this BankFrameRuntimeException to get thrown). |
String |
getMessage()
This method gets the error message as a localized String. |
String |
getMessage(Locale locale)
This method gets the error message as a localized String. |
Throwable |
initCause(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(PrintStream s)
This method prints this throwable and its backtrace to the standard error stream. |
void |
printStackTrace(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. |
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 String EXCEPTION_CLASS_NAME
public static final String EXCEPTION_NAME
public static final String CHAINED_JAVA_EXCEPTION_MSG
public static final String CHAINED_EXCEPTION_DIVIDER
| Constructor Detail |
|---|
public BankFrameRuntimeException(BankFrameMessage message)
message - the error message for the exception
public BankFrameRuntimeException(BankFrameMessage message,
Throwable cause)
message - the error message for the exceptioncause - the original cause of this BankFrameException. This parameter must
not be null.public BankFrameRuntimeException(Throwable cause)
cause - the original cause of this BankFrameException. This parameter must
not be null.| Method Detail |
|---|
public BankFrameMessage getBankFrameMessage()
public Throwable getCause()
getCause in class Throwablepublic String getMessage()
getMessage(Locale locale) instead.
getMessage in class Throwablepublic String getMessage(Locale locale)
locale - the locale to use for localizing the error message
public Throwable initCause(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.
initCause in class Throwablecause - The original cause of the BankFrameRuntimeException
public void printStackTrace()
printStackTrace in class Throwablepublic void printStackTrace(PrintStream s)
printStackTrace in class Throwables - the stream to print topublic void printStackTrace(PrintWriter s)
printStackTrace in class Throwables - The stream to print topublic DataPacket toDataPacket()
public String toString()
getMessage(Locale locale) to convert
the message to a localized String.
toString in class Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||