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.
| Constructor and Description |
|---|
JSPResourceBundle()
This is the default constructor for this class.
|
JSPResourceBundle(java.util.ResourceBundle rb)
This is a constructor for this class.
|
| 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. |
public JSPResourceBundle()
public JSPResourceBundle(java.util.ResourceBundle rb)
JSPResourceBundle
from a ResourceBundle.rb - A ResourceBundle to read from.public boolean isDoubleTheApostrophy()
bDoubleTheApostrophy. The default value is true.getString with parameter substitution will double
apostrophes to prevent removal by the formatter.public void setDoubleTheApostrophy(boolean b)
bDoubleTheApostrophy. The default value is true.A - boolean value; true if apostrophes should be doubled and false otherwise.public static java.lang.Object[] generateMsgParms(java.lang.Object parm1)
Objects to be used as parameters to be passed to a message.parm1 - The value of the first parameter to be substituted into the message text.Object array from the input parameters.public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
java.lang.Object parm2)
Objects to be used as parameters to be passed to a message.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.Object array from the input parameters.public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
java.lang.Object parm2,
java.lang.Object parm3)
Objects to be used as parameters to be passed to a message.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.Object array from the input parameters.public static java.lang.Object[] generateMsgParms(java.lang.Object parm1,
java.lang.Object parm2,
java.lang.Object parm3,
java.lang.Object parm4)
Objects to be used as parameters to be passed to a message.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.Object array from the input parameters.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)
Objects to be used as parameters to be passed to a message.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.Object array from the input parameters.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)
Objects to be used as parameters to be passed to a message.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.Object array from the input parameters.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)
Objects to be used as parameters to be passed to a message.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.Object array from the input parameters.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)
Objects to be used as parameters to be passed to a message.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.Object array from the input parameters.public java.util.Enumeration getKeys()
getKeys in class java.util.ResourceBundlepublic java.lang.String getString(java.lang.String msgKey,
java.lang.Object[] parms,
boolean doubleTheApostrophy)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.public java.lang.String getString(java.lang.String msgKey,
java.lang.Object[] parms)
String message from this resource bundle corresponding to the given
key with parameter substitution.msgKey - A String object that represents the message key.parms - An array of Objects that represent the message parameters.String object that represents the formated message text.public java.lang.String getString(java.lang.String msgKey,
java.lang.String param1)
String message from this resource bundle corresponding to the given
key with parameter substitution.msgKey - A String object that represents the message key.param1 - A String object that represents the message parameter.String object that represents the formated message text.public java.lang.String getString(java.lang.String msgKey,
java.lang.String param1,
java.lang.String param2)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.public java.lang.String getString(java.lang.String msgKey,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.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)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.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)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.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)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.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)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.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)
String message from this resource bundle corresponding to the given
key with parameter substitution.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.String object that represents the formated message text.public java.lang.Object handleGetObject(java.lang.String key)
handleGetObject in class java.util.ResourceBundlekey - The key to retrieve.