org.ceteca.util.resultMessage
Class ResultMessageCatalog

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

public class ResultMessageCatalog
extends java.lang.Object

Holds the catalog of available result messages.
Responsibilities:



Constructor Summary
ResultMessageCatalog(java.io.InputStream isResourcesFile)
          Constructor for ResultMessageCatalog.
ResultMessageCatalog(java.io.InputStream isResourcesFile, I18n i18n)
          Constructor for ResultMessageCatalog.
ResultMessageCatalog(java.io.InputStream isResourcesFile, I18n i18n, Logger logger)
          Constructor for ResultMessageCatalog.
ResultMessageCatalog(java.lang.String resourcesFile)
          Default constructor for ResultMessageCatalog.
ResultMessageCatalog(java.lang.String resourcesFile, I18n i18n)
          Constructor for ResultMessageCatalog.
ResultMessageCatalog(java.lang.String resourcesFile, I18n i18n, Logger logger)
          Constructor for ResultMessageCatalog.
 
Method Summary
 I18n getI18n()
          Gets the internationalization object used for localizing messages.
 java.lang.String getMessage(int resultCode)
          Returns the message string defined for the result code.
 java.lang.String getResourcesFile()
          Gets the message resource file.
static java.lang.String getRevision()
          Returns tag Id assigned to CVS source file.
 ResultMessage newResultMessage(int resCode)
          Creates a new ResultMessage appropriate for the result code.
 ResultMessage newResultMessage(int resCode, java.util.ArrayList lParams)
          Creates a new ResultMessage appropriate for the result code, parametrizing the message with the right values.
 ResultMessage newResultMessage(int resCode, java.util.ArrayList lParams, java.lang.String fieldName)
          Creates a new ResultMessage appropriate for the result code, parametrizing the message with the right values and identifying the cause of the message.
 ResultMessage newResultMessage(int resCode, java.lang.Throwable cause)
          Creates a new ResultMessage appropriate for the result code, identifying the cause of the message.
 ResultMessage newResultMessage(int resCode, java.lang.Throwable cause, java.util.ArrayList lParams)
          Creates a new ResultMessage appropriate for the result code, parametrizing the message with the right values and identifying the cause of the message.
 ResultMessage newResultMessage(int resCode, java.lang.Throwable cause, java.util.ArrayList lParams, java.lang.String fieldName)
          Creates a new ResultMessage appropriate for the result code, parametrizing the message with the right values and identifying the cause of the message.
 void setI18n(I18n i18n)
          Sets up the internationalization object used for localizing messages.
 void setResourcesFile(java.lang.String resourcesFile)
          Sets up the message resource file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultMessageCatalog

public ResultMessageCatalog(java.lang.String resourcesFile)
Default constructor for ResultMessageCatalog. Inits and builds an appropriate result message catalog for the module.

Parameters:
resourcesFile - String, path to the messages resources file.

ResultMessageCatalog

public ResultMessageCatalog(java.io.InputStream isResourcesFile)
Constructor for ResultMessageCatalog. Inits and builds an appropriate result message catalog for the module.

Parameters:
isResourcesFile - InputStream, input stream opened for reading the messages resources file.

ResultMessageCatalog

public ResultMessageCatalog(java.lang.String resourcesFile,
                            I18n i18n)
Constructor for ResultMessageCatalog. Inits and builds an appropriate result message catalog for the module.

Parameters:
resourcesFile - String, path to the messages resources file.
i18n - I18n, instance of internationalization used for localizing messages.

ResultMessageCatalog

public ResultMessageCatalog(java.io.InputStream isResourcesFile,
                            I18n i18n)
Constructor for ResultMessageCatalog. Inits and builds an appropriate result message catalog for the module.

Parameters:
isResourcesFile - InputStream, input stream opened for reading the messages resources file.
i18n - I18n, instance of internationalization used for localizing messages.

ResultMessageCatalog

public ResultMessageCatalog(java.lang.String resourcesFile,
                            I18n i18n,
                            Logger logger)
Constructor for ResultMessageCatalog. Inits and builds an appropriate result message catalog for the module.

Parameters:
resourcesFile - String, path to the messages resources file.
i18n - I18n, instance of internationalization used for localizing messages.
logger - Logger, logger instance used for the logging of the module.

ResultMessageCatalog

public ResultMessageCatalog(java.io.InputStream isResourcesFile,
                            I18n i18n,
                            Logger logger)
Constructor for ResultMessageCatalog. Inits and builds an appropriate result message catalog for the module.

Parameters:
isResourcesFile - InputStream, input stream opened for reading the messages resources file.
i18n - I18n, instance of internationalization used for localizing messages.
logger - Logger, logger instance used for the logging of the module.
Method Detail

getResourcesFile

public java.lang.String getResourcesFile()
Gets the message resource file.

Returns:
String, path to the messages resource file.

setResourcesFile

public void setResourcesFile(java.lang.String resourcesFile)
Sets up the message resource file.

Parameters:
resourcesFile - String, path to the messages resource file.

getI18n

public I18n getI18n()
Gets the internationalization object used for localizing messages.

Returns:
I18n, internationalization object.

setI18n

public void setI18n(I18n i18n)
Sets up the internationalization object used for localizing messages.

Parameters:
I18n - i18n, internationalization object.

getMessage

public java.lang.String getMessage(int resultCode)
Returns the message string defined for the result code.

Parameters:
resultCode - int, result code.
Returns:
String, message literal defined for the result code.

newResultMessage

public ResultMessage newResultMessage(int resCode)
Creates a new ResultMessage appropriate for the result code.

Parameters:
resCode - int, result message internal code.
Returns:
ResultMessage, the result message created.

newResultMessage

public ResultMessage newResultMessage(int resCode,
                                      java.util.ArrayList lParams)
Creates a new ResultMessage appropriate 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.
Returns:
ResultMessage, the result message created.

newResultMessage

public ResultMessage newResultMessage(int resCode,
                                      java.util.ArrayList lParams,
                                      java.lang.String fieldName)
Creates a new ResultMessage appropriate 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.
fieldName - String, form field's name linked to the result message.
Returns:
ResultMessage, the result message created.

newResultMessage

public ResultMessage newResultMessage(int resCode,
                                      java.lang.Throwable cause)
Creates a new ResultMessage appropriate 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.
Returns:
ResultMessage, the result message created.

newResultMessage

public ResultMessage newResultMessage(int resCode,
                                      java.lang.Throwable cause,
                                      java.util.ArrayList lParams)
Creates a new ResultMessage appropriate for the result code, parametrizing the message with the right values and 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.
lParams - ArrayList, list of the parameter values for the message.
Returns:
ResultMessage, the result message created.

newResultMessage

public ResultMessage newResultMessage(int resCode,
                                      java.lang.Throwable cause,
                                      java.util.ArrayList lParams,
                                      java.lang.String fieldName)
Creates a new ResultMessage appropriate 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.
Returns:
ResultMessage, the result message created.

getRevision

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