Package org.opencms.i18n
Class CmsMessageContainer
java.lang.Object
org.opencms.i18n.CmsMessageContainer
- All Implemented Interfaces:
Serializable
,I_CmsMessageContainer
Contains a localized message key, it's arguments and a
I_CmsMessageBundle
.Used for delaying the actual message lookup from the bundle to the time the message is displayed, not generated. This is used for localizing internal OpenCms messages. If a message is generated internally by OpenCms, at the time no information about the context of the current user may be available. The message is therefore passed to the class generating the output, where a user context usually exists. Finally, the message is rendered with the locale of the available user, or the OpenCms default locale if no user is available.
- Since:
- 6.0.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCmsMessageContainer
(I_CmsMessageBundle bundle, String key) Creates a new message container for a key without arguments.CmsMessageContainer
(I_CmsMessageBundle bundle, String key, Object... args) Creates a new message container. -
Method Summary
Modifier and TypeMethodDescriptionObject[]
getArgs()
Returns the message arguments to use.Returns the message bundle used by this container.getKey()
Returns the message key to use.key()
Returns the localized message described by this container for the OpenCms default locale.Returns the localized message described by this container for the given locale.toString()
-
Field Details
-
m_args
The message arguments to use. -
m_bundle
The OpenCms message bundle to read the message from. -
m_key
The message key to use.
-
-
Constructor Details
-
CmsMessageContainer
Creates a new message container for a key without arguments.- Parameters:
bundle
- the OpenCms message bundle to read the message fromkey
- the message key to use
-
CmsMessageContainer
Creates a new message container.- Parameters:
bundle
- the OpenCms message bundle to read the message fromkey
- the message key to useargs
- the message arguments to use
-
-
Method Details
-
getArgs
Returns the message arguments to use.- Returns:
- the message arguments to use
-
getBundle
Returns the message bundle used by this container.- Returns:
- the message bundle used by this container
-
getKey
Returns the message key to use.- Returns:
- the message key to use
-
key
Returns the localized message described by this container for the OpenCms default locale.- Returns:
- the localized message described by this container for the OpenCms default locale
-
key
Returns the localized message described by this container for the given locale.- Specified by:
key
in interfaceI_CmsMessageContainer
- Parameters:
locale
- the locale to use- Returns:
- the localized message described by this container for the given locale
-
toString
-