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 ECMessage objects.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      static java.lang.String SYSTEM_RESOURCE
      This is the default value of the system resource bundle.
      static java.lang.String USER_RESOURCE
      This is the default value of the user resource bundle.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ECMessageHelper() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String doubleTheApostrophy(java.lang.String theString)
      This method inserts an additional apostrophe if the message text contains an apostrophe.
      static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
      This method creates an array of Objects to be used as parameters to be passed to a message.
      static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2)
      This method creates an array of Objects 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)
      This method creates an array of Objects 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)
      This method creates an array of Objects 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)
      This method creates an array of Objects 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)
      This method creates an array of Objects to be used as parameters to be passed to a message.
      static java.lang.String getCorrectiveActionMessage(ECMessage ecmsg, java.util.Locale locale)
      This method gets the textual description of the corrective action message.
      static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
      This method 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)
      This method gets the textual description of a message based on its type (user or system message).
      static java.lang.String getResourceBundleName(ECMessage ecmsg)
      This method gets 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)
      This method gets 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)
      This method 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)
      This method gets the textual description of the user message.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        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
        This is the default value of the user resource bundle.
        See Also:
        Constant Field Values
      • SYSTEM_RESOURCE

        public static final java.lang.String SYSTEM_RESOURCE
        This is the 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)
        This method inserts an additional apostrophe if the message text contains an apostrophe. This method is used when message formatting is required.
        Parameters:
        theString - This is the message text.
        Returns:
        This method returns the message text with addition apostrophe if needed
      • generateMsgParms

        public static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
        This method creates an array of Objects to be used as parameters to be passed to a message.
        Parameters:
        parm1 - This is the value of the parameter to be substituted into the message text.
        Returns:
        This method returns an array with generated message parameters.
      • generateMsgParms

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

        public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
                                                          java.lang.Object parm2,
                                                          java.lang.Object parm3)
        This method creates an array of Objects to be used as parameters to be passed to a message.
        Parameters:
        parm1 - This is the value of the first parameter to be substituted into the message text.
        parm2 - This is the value of the second parameter to be substituted into the message text.
        parm3 - This is the value of the third parameter to be substituted into the message text.
        Returns:
        This method returns an 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)
        This method creates an array of Objects to be used as parameters to be passed to a message.
        Parameters:
        parm1 - This is the value of the first parameter to be substituted into the message text.
        parm2 - This is the value of the second parameter to be substituted into the message text.
        parm3 - This is the value of the third parameter to be substituted into the message text.
        parm4 - This is the value of the fourth parameter to be substituted into the message text.
        Returns:
        This method returns an 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)
        This method creates an array of Objects to be used as parameters to be passed to a message.
        Parameters:
        parm1 - This is the value of the first parameter to be substituted into the message text.
        parm2 - This is the value of the second parameter to be substituted into the message text.
        parm3 - This is the value of the third parameter to be substituted into the message text.
        parm4 - This is the value of the fourth parameter to be substituted into the message text.
        parm5 - This is the value of the fifth parameter to be substituted into the message text.
        Returns:
        This method returns an 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)
        This method creates an array of Objects to be used as parameters to be passed to a message.
        Parameters:
        parm1 - This is the value of the first parameter to be substituted into the message text.
        parm2 - This is the value of the second parameter to be substituted into the message text.
        parm3 - This is the value of the third parameter to be substituted into the message text.
        parm4 - This is the value of the fourth parameter to be substituted into the message text.
        parm5 - This is the value of the fifth parameter to be substituted into the message text.
        parm6 - This is the value of the fifth parameter to be substituted into the message text.
        Returns:
        This method returns an array with generated message parameters.
      • getExceptionStackTrace

        public static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
        This method gets a String object that contains the stack trace of the exception passed as an argument.
        Parameters:
        e - This is a Throwable object that contains stack trace information.
        Returns:
        This method returns a String object that contains the indicated stack trace.
      • getMessage

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

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

        public static java.lang.String getSystemMessage(ECMessage ecmsg,
                                                        java.lang.Object[] parms)
        This method gets the textual description of the system message passed as argument.
        Parameters:
        ecmsg - This is the message object.
        params - This is an array of Objects used for placeholders replacement in the message text.
        Returns:
        This method returns the system message text.
      • getSystemMessage

        public static java.lang.String getSystemMessage(ECMessage ecmsg,
                                                        java.lang.Object[] parms,
                                                        java.util.Locale locale)
        This method gets the textual description of the system message passed as argument.
        Parameters:
        ecmsg - This is the message object
        params - This is an array of Objects used for placeholders replacement in the message text.
        locale - This is the locale used to retrieve the message
        Returns:
        This method returns the message text.
      • getUserMessage

        public static java.lang.String getUserMessage(ECMessage ecmsg,
                                                      java.lang.Object[] parms,
                                                      java.util.Locale locale)
        This method gets the textual description of the user message.
        Parameters:
        ecmsg - This is the message object.
        parms - This is an array of Objects used for placeholders replacement in the message text.
        locale - This is the locale used to identify the resource bundle containing the translated message.
        Returns:
        This method returns the user message text.
      • getCorrectiveActionMessage

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