Anyframe Core

anyframe.common.exception
Class NestedRuntimeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by anyframe.common.exception.NestedRuntimeException
All Implemented Interfaces:
AnyFrameMessageSource, Serializable

public class NestedRuntimeException
extends RuntimeException
implements AnyFrameMessageSource

RuntimeException

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
NestedRuntimeException()
           
NestedRuntimeException(MessageSource messageSource, String messageKey)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
NestedRuntimeException(MessageSource messageSource, String messageKey, Object[] messageParameters)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
NestedRuntimeException(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).
NestedRuntimeException(MessageSource messageSource, String messageKey, Throwable wrappedException)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
NestedRuntimeException(String message)
          Constructor with a message key.
NestedRuntimeException(String message, Object[] messageParameters)
          The constructor with a message key and parameters.
NestedRuntimeException(String message, Object[] messageParameters, Throwable wrappedException)
          The constructor with a message key, with parameters, and with a wrapped exception (with all the formal parameters).
NestedRuntimeException(String message, Throwable exception)
          Constructor with a message key 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

NestedRuntimeException

public NestedRuntimeException(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

NestedRuntimeException

public NestedRuntimeException(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

NestedRuntimeException

public NestedRuntimeException(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

NestedRuntimeException

public NestedRuntimeException(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

NestedRuntimeException

public NestedRuntimeException(String message,
                              Object[] messageParameters,
                              Throwable wrappedException)
The constructor with a message key, 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

NestedRuntimeException

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

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

NestedRuntimeException

public NestedRuntimeException()

NestedRuntimeException

public NestedRuntimeException(String message)
Constructor with a message key.

Parameters:
message - the message of this exception

NestedRuntimeException

public NestedRuntimeException(String message,
                              Throwable exception)
Constructor with a message key 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.