MessageCatalog Class
DEPRECATED Use Weblogic Internationalization utilities
- public class MessageCatalog
extends Object
A message catalog is a collection of property files that store paired
sets of keyed messages. The MessageCatalog
exposes an API
for accessing catalog messages. Each message catalog property file
obeys the following naming convention:
namespace_[language]_[country]_[variant].properties
The namespace describes the type of messages contained in the property
file, whereas the language, country, and variant describe a locale (as
represented by the Locale
). In order to expose the
messages contained in a message catalog property file, the file must
be included in the classpath.
Each property file contains zero or more lines of the following format:
messageKey.user=[user message]
messageKey.log=[log message]
Both the user and log messages are a description of the message itself;
however, the user message text is targeted at developers, whereas the log
message text is targeted at application administrators. Both the user
and log messages may contain parameter substitution tags for supporting
dynamic message parameter substitution. To do so, use substitution tags of
the form described in the documentation for MessageFormat
.
Example:
message1.log=Could not access account {1,number,integer}.
Related Topics
PropertyResourceBundle
MessageFormat
-
Hierarchy
-
Object
MessageCatalog
public static String |
-
getLogMessage (String messageKey)
- Retrieves a catalog log message by default namespace and message key.
|
public static String |
-
getLogMessage (String messageKey, Object argument)
- Retrieves a catalog log message by default namespace and message key and performs
parameter substitution on the target message using the supplied argument.
|
public static String |
-
getLogMessage (String messageKey, Object [] arguments)
- Retrieves a catalog log message by default namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
|
public static String |
-
getLogMessage (String namespace, String messageKey)
- Retrieves a catalog log message by namespace and message key.
|
public static String |
-
getLogMessage (String namespace, String messageKey, Object argument)
- Retrieves a catalog log message by namespace and message key and performs
parameter substitution on the target message using the supplied argument.
|
public static String |
-
getLogMessage (String namespace, String messageKey, Object [] arguments)
- Retrieves a catalog log message by namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
|
protected static String |
-
getMessage (String namespace, String messageKey, String messageKeySuffix, Object [] arguments)
- Retrieves a catalog message by namespace, message key, and message key
suffix and performs parameter substitution on the target message using
the supplied arguments.
|
protected static ResourceBundle |
-
getResourceBundle (String namespace)
- Searches the cached resource bundles for the resource bundle
of the supplied namespace and locale, and returns it if found.
|
public static String |
-
getUserMessage (String messageKey)
- Retrieves a catalog user message by default namespace and message key.
|
public static String |
-
getUserMessage (String messageKey, Object argument)
- Retrieves a catalog user message by default namespace and message key and performs
parameter substitution on the target message using the supplied argument.
|
public static String |
-
getUserMessage (String messageKey, Object [] arguments)
- Retrieves a catalog user message by default namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
|
public static String |
-
getUserMessage (String namespace, String messageKey)
- Retrieves a catalog user message by namespace and message key.
|
public static String |
-
getUserMessage (String namespace, String messageKey, Object argument)
- Retrieves a catalog user message by namespace and message key and performs
parameter substitution on the target message using the supplied argument.
|
public static String |
-
getUserMessage (String namespace, String messageKey, Object [] arguments)
- Retrieves a catalog user message by namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
|
public static void |
-
main (String [] args)
- UT entry point.
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cachedResourceBundles
protected static Hashtable
cachedResourceBundles
DEFAULT_MESSAGE
public static final String
DEFAULT_MESSAGE
DEFAULT_NAMESPACE
public static final String
DEFAULT_NAMESPACE
LOG_MESSAGE_SUFFIX
public static final String
LOG_MESSAGE_SUFFIX
USER_MESSAGE_SUFFIX
public static final String
USER_MESSAGE_SUFFIX
MessageCatalog
public MessageCatalog()
getLogMessage(String) Method
public static String
getLogMessage(String
messageKey)
Retrieves a catalog log message by default namespace and message key.
Parameters
-
messageKey
- The key of the target message.
Returns
- The catalog message described by the given namespace and message key.
getLogMessage(String, Object) Method
public static String
getLogMessage(String
messageKey,
Object
argument)
Retrieves a catalog log message by default namespace and message key and performs
parameter substitution on the target message using the supplied argument.
Parameters
-
messageKey
- The key of the target message.
-
argument
- The substitution argument.
Returns
- The catalog message described by the given namespace and message key, with
the given message argument substituted.
getLogMessage(String, Object[]) Method
public static String
getLogMessage(String
messageKey,
Object
[] arguments)
Retrieves a catalog log message by default namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
Parameters
-
messageKey
- The key of the target message.
-
arguments
- The substitution arguments.
Returns
- The catalog message described by the given namespace and message key, with
the given message arguments substituted.
getLogMessage(String, String) Method
public static String
getLogMessage(String
namespace,
String
messageKey)
Retrieves a catalog log message by namespace and message key.
Parameters
-
namespace
- The namespace of the target message.
-
messageKey
- The key of the target message.
Returns
- The catalog message described by the given namespace and message key.
getLogMessage(String, String, Object) Method
public static String
getLogMessage(String
namespace,
String
messageKey,
Object
argument)
Retrieves a catalog log message by namespace and message key and performs
parameter substitution on the target message using the supplied argument.
Parameters
-
namespace
- The namespace of the target message.
-
messageKey
- The key of the target message.
-
argument
- The substitution argument.
Returns
- The catalog message described by the given namespace and message key, with
the given message argument substituted.
getLogMessage(String, String, Object[]) Method
public static String
getLogMessage(String
namespace,
String
messageKey,
Object
[] arguments)
Retrieves a catalog log message by namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
Parameters
-
namespace
- The namespace of the target message.
-
messageKey
- The key of the target message.
-
arguments
- The substitution arguments.
Returns
- The catalog message described by the given namespace and message key, with
the given message arguments substituted.
getMessage(String, String, String, Object[]) Method
protected static String
getMessage(String
namespace,
String
messageKey,
String
messageKeySuffix,
Object
[] arguments)
Retrieves a catalog message by namespace, message key, and message key
suffix and performs parameter substitution on the target message using
the supplied arguments.
Parameters
-
namespace
- The namespace of the target message.
-
messageKey
- The key of the target message.
-
messageKeySuffix
- The key suffix of the target message.
-
arguments
- The substitution arguments.
Returns
- The catalog message described by the given namespace and message key, with
the given message arguments substituted.
getResourceBundle(String) Method
protected static ResourceBundle
getResourceBundle(String
namespace)
Searches the cached resource bundles for the resource bundle
of the supplied namespace and locale, and returns it if found.
if the resource bundle is not found in the cache, the resource
bundle is looked up and added to the cache. If, in both cases,
the resource bundle could not be found, null
is
returned.
Returns
- The described resource bundle, or
null
getUserMessage(String) Method
public static String
getUserMessage(String
messageKey)
Retrieves a catalog user message by default namespace and message key.
Parameters
-
messageKey
- The key of the target message.
Returns
- The catalog message described by the given namespace and message key.
getUserMessage(String, Object) Method
public static String
getUserMessage(String
messageKey,
Object
argument)
Retrieves a catalog user message by default namespace and message key and performs
parameter substitution on the target message using the supplied argument.
Parameters
-
messageKey
- The key of the target message.
-
argument
- The substitution argument.
Returns
- The catalog message described by the given namespace and message key, with
the given message argument substituted.
getUserMessage(String, Object[]) Method
public static String
getUserMessage(String
messageKey,
Object
[] arguments)
Retrieves a catalog user message by default namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
Parameters
-
messageKey
- The key of the target message.
-
arguments
- The substitution arguments.
Returns
- The catalog message described by the given namespace and message key, with
the given message arguments substituted.
getUserMessage(String, String) Method
public static String
getUserMessage(String
namespace,
String
messageKey)
Retrieves a catalog user message by namespace and message key.
Parameters
-
namespace
- The namespace of the target message.
-
messageKey
- The key of the target message.
Returns
- The catalog message described by the given namespace and message key.
getUserMessage(String, String, Object) Method
public static String
getUserMessage(String
namespace,
String
messageKey,
Object
argument)
Retrieves a catalog user message by namespace and message key and performs
parameter substitution on the target message using the supplied argument.
Parameters
-
namespace
- The namespace of the target message.
-
messageKey
- The key of the target message.
-
argument
- The substitution argument.
Returns
- The catalog message described by the given namespace and message key, with
the given message argument substituted.
getUserMessage(String, String, Object[]) Method
public static String
getUserMessage(String
namespace,
String
messageKey,
Object
[] arguments)
Retrieves a catalog user message by namespace and message key and performs
parameter substitution on the target message using the supplied arguments.
Parameters
-
namespace
- The namespace of the target message.
-
messageKey
- The key of the target message.
-
arguments
- The substitution arguments.
Returns
- The catalog message described by the given namespace and message key, with
the given message arguments substituted.
main(String[]) Method
public static void main(String
[] args)
UT entry point.
Parameters
-
args
- The command line arguments.