com.bankframe.localization
Class BankFrameRuntimeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bycom.bankframe.localization.BankFrameRuntimeException
All Implemented Interfaces:
java.io.Serializable

public class BankFrameRuntimeException
extends java.lang.RuntimeException

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.

Author:
ETU
See Also:
Serialized Form

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

EXCEPTION_CLASS_NAME

public static final java.lang.String EXCEPTION_CLASS_NAME
See Also:
Constant Field Values

EXCEPTION_NAME

public static final java.lang.String EXCEPTION_NAME
See Also:
Constant Field Values

CHAINED_JAVA_EXCEPTION_MSG

public static final java.lang.String CHAINED_JAVA_EXCEPTION_MSG
See Also:
Constant Field Values

CHAINED_EXCEPTION_DIVIDER

public static final java.lang.String CHAINED_EXCEPTION_DIVIDER
See Also:
Constant Field Values
Constructor Detail

BankFrameRuntimeException

public BankFrameRuntimeException(BankFrameMessage message)
Constructor.

Parameters:
message - the error message for the exception

BankFrameRuntimeException

public BankFrameRuntimeException(BankFrameMessage message,
                                 java.lang.Throwable cause)
Constructor. Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters:
message - the error message for the exception
cause - the original cause of this BankFrameException. This parameter must not be null.

BankFrameRuntimeException

public BankFrameRuntimeException(java.lang.Throwable cause)
Constructor.

Parameters:
cause - the original cause of this BankFrameException. This parameter must not be null.
Method Detail

getBankFrameMessage

public BankFrameMessage getBankFrameMessage()
This method gets the BankFrameMessage object.

Returns:
a BankFrameMessage instance

getCause

public 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).

Returns:
the cause of this Throwable or null if the cause is nonexistent or unknown.

getMessage

public java.lang.String getMessage()
This method gets the error message as a localized String. This method uses the default Locale. Use this method with caution, or use getMessage(Locale locale) instead.

Returns:
Localized error message

getMessage

public java.lang.String getMessage(java.util.Locale locale)
This method gets the error message as a localized String. This method uses the specified Locale.

Parameters:
locale - the locale to use for localizing the error message
Returns:
the localized error message

initCause

public java.lang.Throwable initCause(java.lang.Throwable cause)
Initializes the cause of this Throwable to the specified value. (The cause is the Throwable that caused this BankFrameRuntimeException to get thrown). This method can be called at most once. It is generally called from within the constructor, or immediately after creating the BankFrameRuntimeException. If this throwable was created with 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.

Parameters:
cause - The original cause of the BankFrameRuntimeException
Returns:
an instance of this BankFrameRuntimeException

printStackTrace

public void printStackTrace()
This method prints this throwable and its backtrace to the standard error stream;


printStackTrace

public void printStackTrace(java.io.PrintStream s)
This method prints this throwable and its backtrace to the standard error stream.

Parameters:
s - the stream to print to

printStackTrace

public void printStackTrace(java.io.PrintWriter s)
This method prints this throwable and its backtrace to the standard error stream.

Parameters:
s - The stream to print to

toDataPacket

public DataPacket toDataPacket()
This method converts the exception to a DataPacket.

Returns:
a DataPacket instance

toString

public java.lang.String toString()
This method converts the exception to a String. Use this method for debugging purposes. Use getMessage(Locale locale) to convert the message to a localized String.



Copyright © 2004 Siebel Systems, Inc. All rights reserved.