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
           
static java.lang.String SYSTEM_RESOURCE
           
static java.lang.String USER_RESOURCE
           
 
Constructor Summary
ECMessageHelper()
           
 
Method Summary
static java.lang.String doubleTheApostrophy(java.lang.String theString)
          Insert an addition apostrophy if the message text contains a apostrophy.
static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
          Create 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)
          Create 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)
          Create 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)
          Create 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)
          Create 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 object array to be used as parameters to be passed to a message.
static java.lang.String getCorrectiveActionMessage(ECMessage ecmsg, java.util.Locale locale)
          Return the textual description of the message passed as a parameter.
static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
          Returns 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)
          Returns the textual description of a message based on its type (user or system message).
static java.lang.String getResourceBundleName(ECMessage ecmsg)
          Return 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)
          Return 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)
          Return 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)
          Return the textual description of the message passed as a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

SYSTEM_RESOURCE

public static final java.lang.String SYSTEM_RESOURCE

USER_RESOURCE

public static final java.lang.String USER_RESOURCE
Constructor Detail

ECMessageHelper

public ECMessageHelper()
Method Detail

doubleTheApostrophy

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

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
Create 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.

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2)
Create 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 first parameter to be substituted into the message text.

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2,
                                                  java.lang.Object parm3)
Create 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.

generateMsgParms

public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                  java.lang.Object parm2,
                                                  java.lang.Object parm3,
                                                  java.lang.Object parm4)
Create 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.

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)
Create 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.

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 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.
parm6 - Value of the sixth parameter to be substituted into the message text.

getCorrectiveActionMessage

public static java.lang.String getCorrectiveActionMessage(ECMessage ecmsg,
                                                          java.util.Locale locale)
Return the textual description of the message passed as a parameter.
Parameters:
ecmsg - com.ibm.commerce.ras.ECMessage
locale - Locale Used to identify the resource bundle containing the translated message. If null, default locale is used.
Returns:
java.lang.String

getExceptionStackTrace

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

getMessage

public static java.lang.String getMessage(ECMessage ecmsg,
                                          java.lang.Object[] params,
                                          java.util.Locale locale)
Returns the textual description of a message based on its type (user or system message).
Parameters:
ecmsg - com.ibm.commerce.ras.ECMessage
Returns:
java.lang.String

getResourceBundleName

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

getSystemMessage

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

getSystemMessage

public static java.lang.String getSystemMessage(ECMessage ecmsg,
                                                java.lang.Object[] parms,
                                                java.util.Locale locale)
Return the textual description of the system message passed as argument.
Parameters:
ecmsg - com.ibm.commerce.ras.ECMessage
parms - Object [] 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:
java.lang.String

getUserMessage

public static java.lang.String getUserMessage(ECMessage ecmsg,
                                              java.lang.Object[] parms,
                                              java.util.Locale locale)
Return the textual description of the message passed as a parameter.
Parameters:
ecmsg - com.ibm.commerce.ras.ECMessage
parms - Object [] 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:
java.lang.String