org.opencms.i18n
Interface I_CmsMessageBundle

All Known Implementing Classes:
A_CmsMessageBundle

public interface I_CmsMessageBundle

Utility interface for generating localized messages for internal OpenCms operations.

Every OpenCms core packages should provide one class implementing this interface. This class should be called Messages and be a subclass of A_CmsMessageBundle. Moreover, the implementation should contain a public static I_CmsMessageBundle get() method, that returns an instance of the class. Also the implementation should contain public static members for all available localized keys.

Since:
6.0.0
Version:
$Revision: 1.5 $
Author:
Alexander Kandzior

Method Summary
 CmsMessageContainer container(String key)
          Creates a message container for this package with the given arguments.
 CmsMessageContainer container(String key, Object arg0)
          Creates a message container for this package with the given arguments.
 CmsMessageContainer container(String key, Object[] args)
          Creates a message container for this package with the given arguments.
 CmsMessageContainer container(String key, Object arg0, Object arg1)
          Creates a message container for this package with the given arguments.
 CmsMessageContainer container(String key, Object arg0, Object arg1, Object arg2)
          Creates a message container for this package with the given arguments.
 CmsMessages getBundle()
          Returns the localized message bundle wrapped in this instance initialized with the OpenCms default locale.
 CmsMessages getBundle(Locale locale)
          Returns the localized message bundle wrapped in this instance initialized with the provided locale.
 String getBundleName()
          Returns the bundle name for this OpenCms package.
 String key(Locale locale, String key, Object[] args)
          Returns the selected localized message from this bundle for the given locale.
 String key(String key)
          Returns the selected localized message from this bundle for the OpenCms default locale.
 String key(String key, Object arg0)
          Returns the selected localized message from this bundle for the OpenCms default locale.
 String key(String key, Object[] args)
          Returns the selected localized message from this bundle for the OpenCms default locale.
 String key(String key, Object arg0, Object arg1)
          Returns the selected localized message from this bundle for the OpenCms default locale.
 String key(String key, Object arg0, Object arg1, Object arg2)
          Returns the selected localized message from this bundle for the OpenCms default locale.
 

Method Detail

container

public CmsMessageContainer container(String key)
Creates a message container for this package with the given arguments.

Convenience method for a message with no arguments.

Parameters:
key - the message key to use
Returns:
a message container for this package with the given arguments

container

public CmsMessageContainer container(String key,
                                     Object arg0)
Creates a message container for this package with the given arguments.

Convenience method for a message with one argument.

Parameters:
key - the message key to use
arg0 - the message argument
Returns:
a message container for this package with the given arguments

container

public CmsMessageContainer container(String key,
                                     Object arg0,
                                     Object arg1)
Creates a message container for this package with the given arguments.

Convenience method for a message with two arguments.

Parameters:
key - the message key to use
arg0 - the first message argument
arg1 - the second message argument
Returns:
a message container for this package with the given arguments

container

public CmsMessageContainer container(String key,
                                     Object arg0,
                                     Object arg1,
                                     Object arg2)
Creates a message container for this package with the given arguments.

Convenience method for a message with three arguments.

Parameters:
key - the message key to use
arg0 - the first message argument
arg1 - the second message argument
arg2 - the third message argument
Returns:
a message container for this package with the given arguments

container

public CmsMessageContainer container(String key,
                                     Object[] args)
Creates a message container for this package with the given arguments.

Parameters:
key - the message key to use
args - the message arguments to use
Returns:
a message container for this package with the given arguments

getBundle

public CmsMessages getBundle()
Returns the localized message bundle wrapped in this instance initialized with the OpenCms default locale.

Returns:
the localized message bundle wrapped in this instance initialized with the OpenCms default locale

getBundle

public CmsMessages getBundle(Locale locale)
Returns the localized message bundle wrapped in this instance initialized with the provided locale.

Parameters:
locale - the locale to use
Returns:
the localized message bundle wrapped in this instance initialized with the provided locale

getBundleName

public String getBundleName()
Returns the bundle name for this OpenCms package.

Returns:
the bundle name for this OpenCms package

key

public String key(Locale locale,
                  String key,
                  Object[] args)
Returns the selected localized message from this bundle for the given locale.

Parameters:
locale - the locale to use
key - the message key
args - the message arguments
Returns:
the selected localized message from this bundle for the given locale

key

public String key(String key)
Returns the selected localized message from this bundle for the OpenCms default locale.

Convenience method for messages without arguments.

Parameters:
key - the message key
Returns:
the selected localized message from this bundle for the OpenCms default locale

key

public String key(String key,
                  Object arg0)
Returns the selected localized message from this bundle for the OpenCms default locale.

Convenience method for messages with one argument.

Parameters:
key - the message key
arg0 - the message argument
Returns:
the selected localized message from this bundle for the OpenCms default locale

key

public String key(String key,
                  Object arg0,
                  Object arg1)
Returns the selected localized message from this bundle for the OpenCms default locale.

Convenience method for messages with two arguments.

Parameters:
key - the message key
arg0 - the first message argument
arg1 - the second message argument
Returns:
the selected localized message from this bundle for the OpenCms default locale

key

public String key(String key,
                  Object arg0,
                  Object arg1,
                  Object arg2)
Returns the selected localized message from this bundle for the OpenCms default locale.

Convenience method for messages with three arguments.

Parameters:
key - the message key
arg0 - the first message argument
arg1 - the second message argument
arg2 - the third message argument
Returns:
the selected localized message from this bundle for the OpenCms default locale

key

public String key(String key,
                  Object[] args)
Returns the selected localized message from this bundle for the OpenCms default locale.

Parameters:
key - the message key
args - the message arguments
Returns:
the selected localized message from this bundle for the OpenCms default locale