edu.duke.cs.banjo.utility
Class BanjoException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byedu.duke.cs.banjo.utility.BanjoException
All Implemented Interfaces:
java.io.Serializable

public class BanjoException
extends java.lang.Exception

Defines the exceptions that the application generates.

Details:
- To provide as much meaningful feedback to the user or developer, we use special values for the different exceptions that the application may throw.
- (Developer) To add a new BanjoException, simply add a new constant corresponding to the new exception to the BANJO class' Exception section.
- The BanjoErrorHandler class provides a generic high-level handling of the generated exceptions, available to any GUI class that wants to use it.

Change History:
Created on Aug 12, 2004

Author:
Jurgen Sladeczek (hjs)
For the latest info, please visit www.cs.duke.edu.
See Also:
Serialized Form

Field Summary
(package private)  int exceptionType
           
private  java.lang.String message
           
private static long serialVersionUID
           
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
BanjoException(BanjoException e)
          Constructor for propagating an existing BanjoException.
BanjoException(java.lang.Exception e, int exceptionType)
          Contructor that handles an exception within the code, for which we didn't attach an additional message.
BanjoException(java.lang.Exception e, int exceptionType, java.lang.String customMessage)
          For trapping an existing exception, and attaching both a type and a message to it.
BanjoException(int exceptionType)
          Basic Constructor: creates a BanjoException of one of our defined types.
BanjoException(int exceptionType, java.lang.Object exceptionInfo, java.lang.Object exceptionLocation)
           
BanjoException(int exceptionType, java.lang.String customMessage)
          Is used when we didn't encounter an exception in the code, but rather want to flag an "issue" (e.g., unusable input value, etc)
 
Method Summary
 int getExceptionType()
           
 java.lang.String getMessage()
           
 void setMessage(java.lang.String message)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

message

private java.lang.String message

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

exceptionType

final int exceptionType
Constructor Detail

BanjoException

public BanjoException(int exceptionType)
Basic Constructor: creates a BanjoException of one of our defined types.

Parameters:
exceptionType - The type of the BanjoException to set.

BanjoException

public BanjoException(java.lang.Exception e,
                      int exceptionType)
Contructor that handles an exception within the code, for which we didn't attach an additional message.

Parameters:
e - The Exception that was originally encountered.
exceptionType - The type of the BanjoException to set.

BanjoException

public BanjoException(java.lang.Exception e,
                      int exceptionType,
                      java.lang.String customMessage)
For trapping an existing exception, and attaching both a type and a message to it.

Parameters:
e - The Exception that was encountered, and that triggered the creation of this BanjoException.
Note: when DEV_PRINTSTACKTRACE is turned on, the original exception will be echo-printed to the standard i/o.
exceptionType - The type of the BanjoException to set.
customMessage - The message to attach to the BanjoException.

BanjoException

public BanjoException(BanjoException e)
Constructor for propagating an existing BanjoException.

Parameters:
e - The BanjoException to propagate.

BanjoException

public BanjoException(int exceptionType,
                      java.lang.String customMessage)
Is used when we didn't encounter an exception in the code, but rather want to flag an "issue" (e.g., unusable input value, etc)

Parameters:
exceptionType - The type of the BanjoException to set.
customMessage - The message to attach to the BanjoException.

BanjoException

public BanjoException(int exceptionType,
                      java.lang.Object exceptionInfo,
                      java.lang.Object exceptionLocation)
Method Detail

getExceptionType

public int getExceptionType()
Returns:
Returns the exceptionType.

getMessage

public java.lang.String getMessage()
Returns:
Returns the message.

setMessage

public void setMessage(java.lang.String message)
Parameters:
message - The message to set.