java.lang.Object | +--com.ibm.commerce.ras.ECMessageHelper
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
public static final java.lang.String USER_RESOURCE
public static final java.lang.String SYSTEM_RESOURCE
Constructor Detail |
---|
public ECMessageHelper()
Method Detail |
---|
public static java.lang.String doubleTheApostrophy(java.lang.String theString)
theString
- the message text.public static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
parm1
- value of the parameter to be substituted into the
message textpublic static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2)
parm1
- value of first the parameter to be substituted into
the message textparm2
- value of second the parameter to be substituted into
the message textpublic static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3)
parm1
- Value of the first parameter to be substituted into
the message textparm2
- Value of the second parameter to be substituted into
the message textparm3
- Value of the third parameter to be substituted into
the message textpublic static java.lang.Object[] generateMsgParms(java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3, java.lang.Object parm4)
parm1
- Value of the first parameter to be substituted into
the message textparm2
- Value of the second parameter to be substituted into
the message textparm3
- Value of the third parameter to be substituted into
the message textparm4
- Value of the fourth parameter to be substituted into
the message textpublic 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)
parm1
- Value of the first parameter to be substituted into
the message textparm2
- Value of the second parameter to be substituted into
the message textparm3
- Value of the third parameter to be substituted into
the message textparm4
- Value of the fourth parameter to be substituted into
the message textparm5
- Value of the fifth parameter to be substituted into
the message textpublic 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)
parm1
- Value of the first parameter to be substituted into
the message textparm2
- Value of the second parameter to be substituted into
the message textparm3
- Value of the third parameter to be substituted into
the message textparm4
- Value of the fourth parameter to be substituted into
the message textparm5
- Value of the fifth parameter to be substituted into
the message textparm6
- Value of the sixth parameter to be substituted into
the message textpublic static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
e
- Throwable object that contains stack trace
information.public static java.lang.String getMessage(ECMessage ecmsg, java.lang.Object[] params, java.util.Locale locale)
ecmsg
- message objectparams
- array of objects used for placeholders replacement in
the message text.locale
- locale used to retrieve the messagepublic static java.lang.String getResourceBundleName(ECMessage ecmsg)
ecmsg
- message objectpublic static java.lang.String getSystemMessage(ECMessage ecmsg, java.lang.Object[] parms)
ecmsg
- message objectparms
- array of objects used for placeholders replacement in
the message text.public static java.lang.String getSystemMessage(ECMessage ecmsg, java.lang.Object[] parms, java.util.Locale locale)
ecmsg
- message objectparms
- array of objects used for placeholders replacement in
the message textlocale
- Locale used to identify the resource bundle
containing the translated message. If null, default locale is used.public static java.lang.String getUserMessage(ECMessage ecmsg, java.lang.Object[] parms, java.util.Locale locale)
ecmsg
- message objectparms
- array of objects used for placeholders replacement in
the message text.locale
- Locale used to identify the resource bundle
containing the translated message.public static java.lang.String getCorrectiveActionMessage(ECMessage ecmsg, java.util.Locale locale)
ecmsg
- message objectlocale
- Locale used to identify the resource bundle
containing the translated message.