com.ibm.commerce.server

Class JSPResourceBundle

  • java.lang.Object
    • java.util.ResourceBundle
      • com.ibm.commerce.server.JSPResourceBundle


  • public class JSPResourceBundle
    extends java.util.ResourceBundle

    This class is an extension of java.util.ResourceBundle that provides additional capabilities that the parent implementation does not. This includes converting a specific number of parameters into an Object array along with handling the double apostrophe in messages. It can either use the default behaviour or escape the apostrophe if the message text only has one when it should have two. This follows the Java convention.

    It is recommended to use the java.util.ResourceBundle whenever possible and to only use this class in the cases where legacy messages are used and these additional capabilities are required.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.ResourceBundle

        java.util.ResourceBundle.Control
    • Constructor Summary

      Constructors 
      Constructor and Description
      JSPResourceBundle()
      This is the default constructor for this class.
      JSPResourceBundle(java.util.ResourceBundle rb)
      This is a constructor for this class.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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.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, java.lang.Object parm7)
      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, java.lang.Object parm7, java.lang.Object parm8)
      This method creates an array of Objects to be used as parameters to be passed to a message.
      java.util.Enumeration getKeys()
      This method returns the keys associated with the resource bundle.
      java.lang.String getString(java.lang.String msgKey, java.lang.Object[] parms)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.Object[] parms, boolean doubleTheApostrophy)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1, java.lang.String param2)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1, java.lang.String param2, java.lang.String param3)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1, java.lang.String param2, java.lang.String param3, java.lang.String param4)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1, java.lang.String param2, java.lang.String param3, java.lang.String param4, java.lang.String param5)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1, java.lang.String param2, java.lang.String param3, java.lang.String param4, java.lang.String param5, java.lang.String param6)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1, java.lang.String param2, java.lang.String param3, java.lang.String param4, java.lang.String param5, java.lang.String param6, java.lang.String param7)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.String getString(java.lang.String msgKey, java.lang.String param1, java.lang.String param2, java.lang.String param3, java.lang.String param4, java.lang.String param5, java.lang.String param6, java.lang.String param7, java.lang.String param8)
      This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
      java.lang.Object handleGetObject(java.lang.String key)
      This method handles the possible conditions when retrieving an object from the resource bundle.
      boolean isDoubleTheApostrophy()
      This method returns the value of bDoubleTheApostrophy.
      void setDoubleTheApostrophy(boolean b)
      This method sets the value of bDoubleTheApostrophy.
      • Methods inherited from class java.util.ResourceBundle

        clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, keySet
      • Methods inherited from class java.lang.Object

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

      • JSPResourceBundle

        public JSPResourceBundle()
        This is the default constructor for this class. It calls the constructor from the superclass.
      • JSPResourceBundle

        public JSPResourceBundle(java.util.ResourceBundle rb)
        This is a constructor for this class. It creates an instance of a JSPResourceBundle from a ResourceBundle.
        Parameters:
        rb - A ResourceBundle to read from.
    • Method Detail

      • isDoubleTheApostrophy

        public boolean isDoubleTheApostrophy()
        This method returns the value of bDoubleTheApostrophy. The default value is true.
        Returns:
        This method returns true if each getString with parameter substitution will double apostrophes to prevent removal by the formatter.
      • setDoubleTheApostrophy

        public void setDoubleTheApostrophy(boolean b)
        This method sets the value of bDoubleTheApostrophy. The default value is true.
        Parameters:
        A - boolean value; true if apostrophes should be doubled and false otherwise.
      • 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 - The value of the first parameter to be substituted into the message text.
        Returns:
        The Object array from the input 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 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        Returns:
        The Object array from the input 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 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        Returns:
        The Object array from the input 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 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        Returns:
        The Object array from the input 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 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        Returns:
        The Object array from the input 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 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        parm6 - The value of the fifth parameter to be substituted into the message text.
        Returns:
        The Object array from the input 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,
                                                          java.lang.Object parm7)
        This method creates an array of Objects to be used as parameters to be passed to a message.
        Parameters:
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        parm6 - The value of the sixth parameter to be substituted into the message text.
        parm7 - The value of the seventh parameter to be substituted into the message text.
        Returns:
        The Object array from the input 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,
                                                          java.lang.Object parm7,
                                                          java.lang.Object parm8)
        This method creates an array of Objects to be used as parameters to be passed to a message.
        Parameters:
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        parm6 - The value of the sixth parameter to be substituted into the message text.
        parm7 - The value of the seventh parameter to be substituted into the message text.
        parm8 - The value of the eight parameter to be substituted into the message text.
        Returns:
        The Object array from the input parameters.
      • getKeys

        public java.util.Enumeration getKeys()
        This method returns the keys associated with the resource bundle.
        Specified by:
        getKeys in class java.util.ResourceBundle
        Returns:
        The keys of the resource bundle.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.Object[] parms,
                                          boolean doubleTheApostrophy)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parms - An array of Objects that represent the message parameters.
        doubleTheApostrophy - A boolean value; true if the apostrophes in the message should be doubled before parameter substitution and false otherwise.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.Object[] parms)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parms - An array of Objects that represent the message parameters.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        param1 - A String object that represents the message parameter.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1,
                                          java.lang.String param2)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1,
                                          java.lang.String param2,
                                          java.lang.String param3)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1,
                                          java.lang.String param2,
                                          java.lang.String param3,
                                          java.lang.String param4)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1,
                                          java.lang.String param2,
                                          java.lang.String param3,
                                          java.lang.String param4,
                                          java.lang.String param5)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1,
                                          java.lang.String param2,
                                          java.lang.String param3,
                                          java.lang.String param4,
                                          java.lang.String param5,
                                          java.lang.String param6)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        parm6 - The value of the sixth parameter to be substituted into the message text.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1,
                                          java.lang.String param2,
                                          java.lang.String param3,
                                          java.lang.String param4,
                                          java.lang.String param5,
                                          java.lang.String param6,
                                          java.lang.String param7)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        parm6 - The value of the sixth parameter to be substituted into the message text.
        parm7 - The value of the seventh parameter to be substituted into the message text.
        Returns:
        A String object that represents the formated message text.
      • getString

        public java.lang.String getString(java.lang.String msgKey,
                                          java.lang.String param1,
                                          java.lang.String param2,
                                          java.lang.String param3,
                                          java.lang.String param4,
                                          java.lang.String param5,
                                          java.lang.String param6,
                                          java.lang.String param7,
                                          java.lang.String param8)
        This method returns a String message from this resource bundle corresponding to the given key with parameter substitution.
        Parameters:
        msgKey - A String object that represents the message key.
        parm1 - The value of the first parameter to be substituted into the message text.
        parm2 - The value of the second parameter to be substituted into the message text.
        parm3 - The value of the third parameter to be substituted into the message text.
        parm4 - The value of the fourth parameter to be substituted into the message text.
        parm5 - The value of the fifth parameter to be substituted into the message text.
        parm6 - The value of the sixth parameter to be substituted into the message text.
        parm7 - The value of the seventh parameter to be substituted into the message text.
        parm8 - The value of the eight parameter to be substituted into the message text.
        Returns:
        A String object that represents the formated message text.
      • handleGetObject

        public java.lang.Object handleGetObject(java.lang.String key)
        This method handles the possible conditions when retrieving an object from the resource bundle.
        Specified by:
        handleGetObject in class java.util.ResourceBundle
        Parameters:
        key - The key to retrieve.
        Returns:
        The object found that matches the key. If no object is found then the key is returned.