org.ceteca.util.resultMessage
Class ResultMessage

java.lang.Object
  extended by org.ceteca.util.resultMessage.ResultMessage

public class ResultMessage
extends java.lang.Object

This class encapsulates the messages returned to the end user as the result of any user operation in the system.
Responsibilities:



Constructor Summary
ResultMessage(int resCode)
          Constructor for Simple ResultMessage class.
ResultMessage(int resCode, java.util.ArrayList lParams, I18n i18n)
          Constructor for Parametrized ResultMessage class.
ResultMessage(int resCode, java.util.ArrayList lParams, I18n i18n, java.lang.String fieldName)
          Constructor for Parametrized Error ResultMessage class.
ResultMessage(int resCode, I18n i18n)
          Constructor for Simple ResultMessage class.
ResultMessage(int resCode, java.lang.Throwable cause, java.util.ArrayList lParams, I18n i18n, java.lang.String fieldName)
          Constructor for Parametrized Error ResultMessage class.
ResultMessage(int resCode, java.lang.Throwable cause, java.util.ArrayList lParams, java.lang.String fieldName)
          Constructor for Parametrized Error ResultMessage class.
ResultMessage(int resCode, java.lang.Throwable cause, I18n i18n)
          Constructor for Simple Error ResultMessage class.
 
Method Summary
 java.lang.Throwable getExc()
          Gets the exception that raised the result message.
 java.lang.String getFieldName()
          Gets the name of the field that generated the error message.
 java.util.ArrayList getLParams()
          Gets the list of parameters and their values, used in the construction of the result message.
 java.lang.String getMessage()
          Constructs the formatted result message text.
 int getResCode()
          Gets the result code for the result message.
 java.lang.String getResMessage()
          Gets the message label that will be used for constructing the formatted error message.
static java.lang.String getRevision()
          Returns tag Id assigned to CVS source file.
 void setExc(java.lang.Throwable exc)
          Sets up the exception that raised the result message.
 void setFieldName(java.lang.String fieldName)
          Sets up the name of the field that generated the error message.
 void setLParams(java.util.ArrayList params)
          Sets up the list of parameters and their values, used in the construction of the result message.
 void setResCode(int resCode)
          Sets up the result code for the result message.
 void setResMessage(java.lang.String resMessage)
          Sets up the message label that will be used for constructing the formatted error message.
 java.lang.String toString()
          Format the result message to show it to the end user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResultMessage

public ResultMessage(int resCode)
Constructor for Simple ResultMessage class. Builds an appropriate result message for the result code.

Parameters:
resCode - int, result message internal code.

ResultMessage

public ResultMessage(int resCode,
                     I18n i18n)
Constructor for Simple ResultMessage class. Builds an appropriate result message for the result code.

Parameters:
resCode - int, result message internal code.
i18n - I18n, instance of Internationalization object.

ResultMessage

public ResultMessage(int resCode,
                     java.util.ArrayList lParams,
                     I18n i18n)
Constructor for Parametrized ResultMessage class. Builds an appropriate result message for the result code, parametrizing the message with the right values.

Parameters:
resCode - int, result message internal code.
lParams - ArrayList, list of the parameter values for the message.
i18n - I18n, instance of Internationalization object.

ResultMessage

public ResultMessage(int resCode,
                     java.util.ArrayList lParams,
                     I18n i18n,
                     java.lang.String fieldName)
Constructor for Parametrized Error ResultMessage class. Builds an appropriate result message for the result code, parametrizing the message with the right values and identifying the cause of the message. It also adds a form field linked to the result message.

Parameters:
resCode - int, result message internal code.
lParams - ArrayList, list of the parameter values for the message.
i18n - I18n, instance of Internationalization object.
fieldName - String, form field's name linked to the result message.

ResultMessage

public ResultMessage(int resCode,
                     java.lang.Throwable cause,
                     I18n i18n)
Constructor for Simple Error ResultMessage class. Builds an appropriate result message for the result code, identifying the cause of the message.

Parameters:
resCode - int, result message internal code.
cause - Throwable, exception that raised the result message. Only applies with error messages.
i18n - I18n, instance of Internationalization object.

ResultMessage

public ResultMessage(int resCode,
                     java.lang.Throwable cause,
                     java.util.ArrayList lParams,
                     java.lang.String fieldName)
Constructor for Parametrized Error ResultMessage class. Builds an appropriate result message for the result code, parametrizing the message with the right values and identifying the cause of the message. It also adds a form field linked to the result message.

Parameters:
resCode - int, result message internal code.
cause - Throwable, exception that raised the result message. Only applies with error messages.
lParams - ArrayList, list of the parameter values for the message.
fieldName - String, form field's name linked to the result message.

ResultMessage

public ResultMessage(int resCode,
                     java.lang.Throwable cause,
                     java.util.ArrayList lParams,
                     I18n i18n,
                     java.lang.String fieldName)
Constructor for Parametrized Error ResultMessage class. Builds an appropriate result message for the result code, parametrizing the message with the right values and identifying the cause of the message. It also adds a form field linked to the result message.

Parameters:
resCode - int, result message internal code.
cause - Throwable, exception that raised the result message. Only applies with error messages.
lParams - ArrayList, list of the parameter values for the message.
i18n - I18n, instance of Internationalization object.
fieldName - String, form field's name linked to the result message.
Method Detail

getExc

public java.lang.Throwable getExc()
Gets the exception that raised the result message. It comes normally in error or warning messages.

Returns:
Throwable, exception linked to the result message.

setExc

public void setExc(java.lang.Throwable exc)
Sets up the exception that raised the result message. It comes normally in error or warning messages.

Parameters:
exc - Throwable, exception linked to the result message.

getLParams

public java.util.ArrayList getLParams()
Gets the list of parameters and their values, used in the construction of the result message.

Returns:
ArrayList, list of result message parameters.

setLParams

public void setLParams(java.util.ArrayList params)
Sets up the list of parameters and their values, used in the construction of the result message.

Parameters:
params - ArrayList, list of result message parameters.

getResCode

public int getResCode()
Gets the result code for the result message. This code helps the coder to identify and locate the error source.

Returns:
int, result code.

setResCode

public void setResCode(int resCode)
Sets up the result code for the result message. This code helps the coder to identify and locate the error source.

Parameters:
resCode - int, result code.

getResMessage

public java.lang.String getResMessage()
Gets the message label that will be used for constructing the formatted error message. This label will be the base of the message, constructed also with the parameters specified and using the internationalization mechanism to translate the message to the user's language it it's supported.

Returns:
String, message label.

setResMessage

public void setResMessage(java.lang.String resMessage)
Sets up the message label that will be used for constructing the formatted error message. This label will be the base of the message, constructed also with the parameters specified and using the internationalization mechanism to translate the message to the user's language it it's supported.

Parameters:
resMessage - String, message label.

getFieldName

public java.lang.String getFieldName()
Gets the name of the field that generated the error message.

Returns:
String, form field's name.

setFieldName

public void setFieldName(java.lang.String fieldName)
Sets up the name of the field that generated the error message.

Parameters:
fieldName - String, form field's name.

getMessage

public java.lang.String getMessage()
Constructs the formatted result message text.

Returns:
String, formatted result message text.

toString

public java.lang.String toString()
Format the result message to show it to the end user

Overrides:
toString in class java.lang.Object
Returns:
String, the formatted result message.

getRevision

public static java.lang.String getRevision()
Returns tag Id assigned to CVS source file.