Anyframe Core

anyframe.common.exception
Class BaseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by anyframe.common.exception.BaseException
All Implemented Interfaces:
AnyFrameMessageSource, Serializable
Direct Known Subclasses:
QueryServiceException

public class BaseException
extends Exception
implements AnyFrameMessageSource

General Exception

Author:
SoYon Lim, JongHoon Kim
See Also:
Serialized Form

Field Summary
protected  Message message
          Contains user defined message, solution message and reason.
protected  String messageKey
          Contains either the message of the exception or message key.
protected  Object[] messageParameters
          The parameters to substitute.
 
Constructor Summary
BaseException()
          default constructor
BaseException(MessageSource messageSource, String messageKey)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(MessageSource messageSource, String messageKey, Object[] messageParameters)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(MessageSource messageSource, String messageKey, Object[] messageParameters, String defaultMessage)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(MessageSource messageSource, String messageKey, Object[] messageParameters, String defaultMessage, Throwable wrappedException)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(MessageSource messageSource, String messageKey, Object[] messageParameters, Throwable wrappedException)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(MessageSource messageSource, String messageKey, String defaultMessage)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(MessageSource messageSource, String messageKey, String defaultMessage, Throwable wrappedException)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(MessageSource messageSource, String messageKey, Throwable wrappedException)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(String message)
          Constructor with a message.
BaseException(String message, Object[] messageParameters)
          The constructor with a message and parameters.
BaseException(String message, Object[] messageParameters, Throwable wrappedException)
          The constructor with a message, with parameters, and with a wrapped exception (with all the formal parameters).
BaseException(String message, Throwable exception)
          Constructor with a message and an exception.
 
Method Summary
 String getMessage()
          Get the user message for the exception.
 String getMessageKey()
           
 Object[] getMessageParameters()
           
 Message getMessages()
          Get the normal message structure for the exception.
 void setMessageKey(String messageKey)
           
 void setMessageParameters(Object[] messageParameters)
           
 
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

messageKey

protected String messageKey
Contains either the message of the exception or message key.


messageParameters

protected Object[] messageParameters
The parameters to substitute. In subclasses, you may either use this Object[] to hold the messageParameters or (typically preferred) define your own (typed and named) attributes that you need.


message

protected Message message
Contains user defined message, solution message and reason.

Constructor Detail

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey,
                     Object[] messageParameters,
                     String defaultMessage,
                     Throwable wrappedException)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception
messageParameters - the parameters to substitute in the message
defaultMessage - default message
wrappedException - the exception that is wrapped in this exception

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey,
                     Object[] messageParameters,
                     Throwable wrappedException)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception
messageParameters - the parameters to substitute in the message
wrappedException - the exception that is wrapped in this exception

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey,
                     Throwable wrappedException)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception
wrappedException - the exception that is wrapped in this exception

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey,
                     String defaultMessage,
                     Throwable wrappedException)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception
defaultMessage - default message
wrappedException - the exception that is wrapped in this exception

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey,
                     Object[] messageParameters)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception
messageParameters - the parameters to substitute in the message

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey,
                     Object[] messageParameters,
                     String defaultMessage)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception
defaultMessage - default message
messageParameters - the parameters to substitute in the message

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception

BaseException

public BaseException(MessageSource messageSource,
                     String messageKey,
                     String defaultMessage)
The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
messageSource - message management service to extract a message
messageKey - the message key of this exception
defaultMessage - default message

BaseException

public BaseException(String message,
                     Object[] messageParameters,
                     Throwable wrappedException)
The constructor with a message, with parameters, and with a wrapped exception (with all the formal parameters).

Parameters:
message - the message of this exception
messageParameters - the parameters to substitute in the message
wrappedException - the exception that is wrapped in this exception

BaseException

public BaseException(String message,
                     Object[] messageParameters)
The constructor with a message and parameters. No Throwable or Exception is transfered.

Parameters:
message - the message of this exception
messageParameters - the parameters to substitute in the message

BaseException

public BaseException()
default constructor


BaseException

public BaseException(String message)
Constructor with a message.

Parameters:
message - the message of this exception

BaseException

public BaseException(String message,
                     Throwable exception)
Constructor with a message and an exception.

Parameters:
message - the message of this exception
exception - the exception that is wrapped in this exception
Method Detail

getMessages

public Message getMessages()
Get the normal message structure for the exception.

Specified by:
getMessages in interface AnyFrameMessageSource
Returns:
the message structure for the user

getMessage

public String getMessage()
Get the user message for the exception.

Overrides:
getMessage in class Throwable
Returns:
the user message

getMessageKey

public String getMessageKey()

setMessageKey

public void setMessageKey(String messageKey)

getMessageParameters

public Object[] getMessageParameters()

setMessageParameters

public void setMessageParameters(Object[] messageParameters)

Anyframe Core

Copyright © 2008-2009 Samsung SDS. All Rights Reserved.