public class Messages
extends java.lang.Object
implements java.io.Serializable
Profile
.
All message keys retrieved by this class are assumed to be prefixed with "MSG.". Message keys supplied to this class' methods that are not already prefixed with "MSG." will be automatically prefixed when the key is retrieved.
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
Messages() |
Modifier and Type | Method and Description |
---|---|
static boolean |
exists(java.lang.String msgid)
Answers if the given message id exists.
|
static java.lang.String |
get(java.lang.String msgid)
Returns the message text for a given message id.
|
static java.lang.String |
get(java.lang.String msgid,
java.lang.String... values)
Returns the message text for a given message id with the given set of
substitution value(s) inserted into the message text.
|
private static java.lang.String |
getString(java.lang.String msgid)
Returns the message text for a given message id.
|
static java.lang.String |
stripLogLevel(java.lang.String msgtext)
Strips the log level (DEBUG, INFO, WARN, etc.) from the given message text.
|
private static final long serialVersionUID
public static java.lang.String get(java.lang.String msgid)
msgid
- (String) The resource key for the message to retrieve.
If necessary, the msgid is automatically prefixed with "MSG.".public static java.lang.String get(java.lang.String msgid, java.lang.String... values)
msgid
- (String) The resource key for the message to retrieve.
If necessary, the msgid is automatically prefixed with "MSG.".values
- (String) The value(s) that are to be substituted into
the message text. This parameter uses the varargs feature and
can therefore be passed as multiple parms (msgid, value1, value2,
value3, valueN) or as an array (msgid, values[]).private static java.lang.String getString(java.lang.String msgid)
msgid
- (String) The resource key for the message to retrieve.
If necessary, the msgid is automatically prefixed with "MSG.".public static boolean exists(java.lang.String msgid)
msgid
- (String) The resource key for the message to check.
If necessary, the msgid is automatically prefixed with "MSG.".true
if the message id exists,
otherwise false
.public static java.lang.String stripLogLevel(java.lang.String msgtext)
msgtext
- (String) The message text to process.