com.bankframe.localization
Class BankFrameException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.bankframe.localization.BankFrameException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EonException

public class BankFrameException
extends java.lang.Exception

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
BankFrameException(BankFrameMessage message)
          Constructor
BankFrameException(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
BankFrameException(java.lang.Throwable cause)
          Constructor
 
Method Summary
 BankFrameMessage getBankFrameMessage()
          This method gets the BankFrameMessage object
 java.lang.Throwable getCause()
          Returns the cause of this Throwable or null if the cause is nonexistent or unknown.
 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()
          Prints this throwable and its backtrace to the standard error stream;
 void printStackTrace(java.io.PrintStream s)
          Prints this throwable and its backtrace to the standard error stream;
 void printStackTrace(java.io.PrintWriter s)
          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

BankFrameException

public BankFrameException(BankFrameMessage message)
Constructor

Parameters:
message - The error message for the exception

BankFrameException

public BankFrameException(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.

BankFrameException

public BankFrameException(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:
BankFrameMessage instance

getCause

public java.lang.Throwable getCause()
Returns the cause of this Throwable or null if the cause is nonexistent or unknown. (The cause is the Throwable that caused this BankFrameException to get thrown.)


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:
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 BankFrameException to get thrown.) This method can be called at most once. It is generally called from within the constructor, or immediately after creating the BankFrameException. If this throwable was created with BankFrameException(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 BankFrameException
Returns:
An instance of this BankFrameException

printStackTrace

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


printStackTrace

public void printStackTrace(java.io.PrintStream s)
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)
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:
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.