org.jaffa.exceptions
Class CustomException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.jaffa.exceptions.CustomException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ApplicationException, FrameworkException

public abstract class CustomException
extends Exception

This is the base class for all Jaffa exceptions.

See Also:
Serialized Form

Field Summary
protected  Object[] m_arguments
          Holds value of property arguments.
 
Constructor Summary
protected CustomException(String errorCode)
          Creates an exception with the errorCode.
protected CustomException(String errorCode, Object[] arguments)
          Creates an exception with the errorCode and a cause.
protected CustomException(String errorCode, Object[] arguments, Throwable cause)
          Creates an exception with the errorCode and a cause.
 
Method Summary
 Object[] getArguments()
          Getter for property arguments.
 String getLocalizedMessage()
          This will look up the errorCode in the default resource bundle and return an appropriate message.
 String getMessage()
          Returns the message from the base class.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, 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

m_arguments

protected Object[] m_arguments
Holds value of property arguments.

Constructor Detail

CustomException

protected CustomException(String errorCode)
Creates an exception with the errorCode.

Parameters:
errorCode - the errorCode

CustomException

protected CustomException(String errorCode,
                          Object[] arguments)
Creates an exception with the errorCode and a cause.

Parameters:
errorCode - the errorCode.
arguments - the arguments, if any, that need to be merged into the error message from the resource bundle.

CustomException

protected CustomException(String errorCode,
                          Object[] arguments,
                          Throwable cause)
Creates an exception with the errorCode and a cause.

Parameters:
errorCode - the errorCode.
arguments - the arguments, if any, that need to be merged into the error message from the resource bundle.
cause - the cause.
Method Detail

getArguments

public Object[] getArguments()
Getter for property arguments.

Returns:
Value of property arguments.

getLocalizedMessage

public String getLocalizedMessage()
This will look up the errorCode in the default resource bundle and return an appropriate message. The errorCode will be returned as is, if no default resource bundle is specified in the framework.properties file or if no message is found for the error code.

Returns:
the message from the default resource bundle for the errorCode.

getMessage

public String getMessage()
Returns the message from the base class.

Returns:
the message from the base class.


Copyright © 2002-2004 JAFFA Project.