com.ibm.commerce.ras
Class ECMessageHelper

java.lang.Object
  |
  +--com.ibm.commerce.ras.ECMessageHelper

public class ECMessageHelper
extends java.lang.Object

This is a helper class created to enable substitution parameters be added to predefined ECMessages.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
static java.lang.String SYSTEM_RESOURCE
          Default value of the system resource bundle.
static java.lang.String USER_RESOURCE
          Default value of the user resource bundle.
 
Constructor Summary
ECMessageHelper()
           
 
Method Summary
static java.lang.String doubleTheApostrophy(java.lang.String theString)
          Inserts an addition apostrophy if the message text contains a apostrophy.
static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
          Creates an object array to be used as parameters to be passed to a message
static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2)
          Creates an object array to be used as parameters to be passed to a message.
static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3)
          Creates an object array to be used as parameters to be passed to a message.
static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3, java.lang.Object parm4)
          Creates an object array to be used as parameters to be passed to a message.
static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3, java.lang.Object parm4, java.lang.Object parm5)
          Creates an object array to be used as parameters to be passed to a message.
static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3, java.lang.Object parm4, java.lang.Object parm5, java.lang.Object parm6)
          Create an objects array to be used as parameters to be passed to a message.
static java.lang.String getCorrectiveActionMessage( ECMessage ecmsg, java.util.Locale locale)
          Gets the textual description of the corrective action message.
static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
          Gets a string object that contains the stack trace of the exception passed as an argument.
static java.lang.String getMessage(ECMessage ecmsg, java.lang.Object[] params, java.util.Locale locale)
          Gets the textual description of a message based on its type (user or system message).
static java.lang.String getResourceBundleName( ECMessage ecmsg)
          Returns the resource bundle that contains the textual description of the ECMessage object passed as an argument.
static java.lang.String getSystemMessage( ECMessage ecmsg, java.lang.Object[] parms)
          Returns the textual description of the system message passed as argument.
static java.lang.String getSystemMessage( ECMessage ecmsg, java.lang.Object[] parms, java.util.Locale locale)
          Gets the textual description of the system message passed as argument.
static java.lang.String getUserMessage( ECMessage ecmsg, java.lang.Object[] parms, java.util.Locale locale)
          Gets the textual description of the user message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values

USER_RESOURCE

public static final java.lang.String USER_RESOURCE
Default value of the user resource bundle.
See Also:
Constant Field Values

SYSTEM_RESOURCE

public static final java.lang.String SYSTEM_RESOURCE
Default value of the system resource bundle.
See Also:
Constant Field Values
Constructor Detail

ECMessageHelper

public ECMessageHelper()
Method Detail

doubleTheApostrophy

public static java.lang.String doubleTheApostrophy(java.lang.String theString)
Inserts an addition apostrophy if the message text contains a apostrophy. This method is used when message format is required.
Parameters:
theString - the message text.
Returns:
the message text with addition apostrophy if needed

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
Creates an object array to be used as parameters to be passed to a message
Parameters:
parm1 - value of the parameter to be substituted into the message text
Returns:
array with generated message parameters

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2)
Creates an object array to be used as parameters to be passed to a message.
Parameters:
parm1 - value of first the parameter to be substituted into the message text
parm2 - value of second the parameter to be substituted into the message text
Returns:
array with generated message parameters

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2,
                                                  java.lang.Object parm3)
Creates an object array to be used as parameters to be passed to a message.
Parameters:
parm1 - Value of the first parameter to be substituted into the message text
parm2 - Value of the second parameter to be substituted into the message text
parm3 - Value of the third parameter to be substituted into the message text
Returns:
array with generated message parameters

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2,
                                                  java.lang.Object parm3,
                                                  java.lang.Object parm4)
Creates an object array to be used as parameters to be passed to a message.
Parameters:
parm1 - Value of the first parameter to be substituted into the message text
parm2 - Value of the second parameter to be substituted into the message text
parm3 - Value of the third parameter to be substituted into the message text
parm4 - Value of the fourth parameter to be substituted into the message text
Returns:
array with generated message parameters

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2,
                                                  java.lang.Object parm3,
                                                  java.lang.Object parm4,
                                                  java.lang.Object parm5)
Creates an object array to be used as parameters to be passed to a message.
Parameters:
parm1 - Value of the first parameter to be substituted into the message text
parm2 - Value of the second parameter to be substituted into the message text
parm3 - Value of the third parameter to be substituted into the message text
parm4 - Value of the fourth parameter to be substituted into the message text
parm5 - Value of the fifth parameter to be substituted into the message text
Returns:
array with generated message parameters

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2,
                                                  java.lang.Object parm3,
                                                  java.lang.Object parm4,
                                                  java.lang.Object parm5,
                                                  java.lang.Object parm6)
Create an objects array to be used as parameters to be passed to a message.
Parameters:
parm1 - Value of the first parameter to be substituted into the message text
parm2 - Value of the second parameter to be substituted into the message text
parm3 - Value of the third parameter to be substituted into the message text
parm4 - Value of the fourth parameter to be substituted into the message text
parm5 - Value of the fifth parameter to be substituted into the message text
parm6 - Value of the sixth parameter to be substituted into the message text
Returns:
array with generated message parameters

getExceptionStackTrace

public static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
Gets a string object that contains the stack trace of the exception passed as an argument.
Parameters:
e - Throwable object that contains stack trace information.

getMessage

public static java.lang.String getMessage(ECMessage ecmsg,
                                          java.lang.Object[] params,
                                          java.util.Locale locale)
Gets the textual description of a message based on its type (user or system message).
Parameters:
ecmsg - message object
params - array of objects used for placeholders replacement in the message text.
locale - locale used to retrieve the message
Returns:
message text

getResourceBundleName

public static java.lang.String getResourceBundleName(ECMessage ecmsg)
Returns the resource bundle that contains the textual description of the ECMessage object passed as an argument.
Parameters:
ecmsg - message object
Returns:
the resource bundle name

getSystemMessage

public static java.lang.String getSystemMessage(ECMessage ecmsg,
                                                java.lang.Object[] parms)
Returns the textual description of the system message passed as argument.
Parameters:
ecmsg - message object
parms - array of objects used for placeholders replacement in the message text.
Returns:
system message text

getSystemMessage

public static java.lang.String getSystemMessage(ECMessage ecmsg,
                                                java.lang.Object[] parms,
                                                java.util.Locale locale)
Gets the textual description of the system message passed as argument.
Parameters:
ecmsg - message object
parms - array of objects used for placeholders replacement in the message text
locale - Locale used to identify the resource bundle containing the translated message. If null, default locale is used.
Returns:
system message text

getUserMessage

public static java.lang.String getUserMessage(ECMessage ecmsg,
                                              java.lang.Object[] parms,
                                              java.util.Locale locale)
Gets the textual description of the user message.
Parameters:
ecmsg - message object
parms - array of objects used for placeholders replacement in the message text.
locale - Locale used to identify the resource bundle containing the translated message.
Returns:
user message text

getCorrectiveActionMessage

public static java.lang.String getCorrectiveActionMessage(ECMessage ecmsg,
                                                          java.util.Locale locale)
Gets the textual description of the corrective action message.
Parameters:
ecmsg - message object
locale - Locale used to identify the resource bundle containing the translated message.
Returns:
corrective action message