public class CmsMessageContainer extends java.lang.Object implements java.io.Serializable, I_CmsMessageContainer
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.
I_CmsMessageBundle
,
序列化表格限定符和类型 | 字段和说明 |
---|---|
protected java.lang.Object[] |
m_args
The message arguments to use.
|
protected I_CmsMessageBundle |
m_bundle
The OpenCms message bundle to read the message from.
|
protected java.lang.String |
m_key
The message key to use.
|
构造器和说明 |
---|
CmsMessageContainer(I_CmsMessageBundle bundle,
java.lang.String key)
Creates a new message container for a key without arguments.
|
CmsMessageContainer(I_CmsMessageBundle bundle,
java.lang.String key,
java.lang.Object... args)
Creates a new message container.
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.Object[] |
getArgs()
Returns the message arguments to use.
|
I_CmsMessageBundle |
getBundle()
Returns the message bundle used by this container.
|
java.lang.String |
getKey()
Returns the message key to use.
|
java.lang.String |
key()
Returns the localized message described by this container for the OpenCms default locale.
|
java.lang.String |
key(java.util.Locale locale)
Returns the localized message described by this container for the given locale.
|
java.lang.String |
toString() |
protected java.lang.Object[] m_args
protected I_CmsMessageBundle m_bundle
protected java.lang.String m_key
public CmsMessageContainer(I_CmsMessageBundle bundle, java.lang.String key)
bundle
- the OpenCms message bundle to read the message fromkey
- the message key to usepublic CmsMessageContainer(I_CmsMessageBundle bundle, java.lang.String key, java.lang.Object... args)
bundle
- the OpenCms message bundle to read the message fromkey
- the message key to useargs
- the message arguments to usepublic java.lang.Object[] getArgs()
public I_CmsMessageBundle getBundle()
public java.lang.String getKey()
public java.lang.String key()
public java.lang.String key(java.util.Locale locale)
key
在接口中 I_CmsMessageContainer
locale
- the locale to usepublic java.lang.String toString()
toString
在类中 java.lang.Object
Object.toString()