org.opencms.i18n
Class CmsListResourceBundle

java.lang.Object
  extended by java.util.ResourceBundle
      extended by java.util.ListResourceBundle
          extended by org.opencms.i18n.CmsListResourceBundle
All Implemented Interfaces:
I_CmsResourceBundle

public class CmsListResourceBundle
extends java.util.ListResourceBundle
implements I_CmsResourceBundle

A list based resource bundle that with increased visibility of some key methods.

Since:
8.0.1
See Also:
CmsResourceBundleLoader

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.ResourceBundle
java.util.ResourceBundle.Control
 
Field Summary
protected  java.util.Locale m_locale
          The locale to use.
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
CmsListResourceBundle()
          Create a new list resource bundle for the XML.
 
Method Summary
 void addMessage(java.lang.String key, java.lang.String value)
          Adds a message to this list bundle.
 CmsListResourceBundle getClone()
          Returns a typed clone of this resource bundle.
 java.lang.Object[][] getContents()
           
 java.util.Locale getLocale()
           
 void setLocale(java.util.Locale l)
          Sets the locale used for this resource bundle.
 void setParent(java.util.ResourceBundle p)
          Sets the parent bundle.
 
Methods inherited from class java.util.ListResourceBundle
getKeys, handleGetObject, handleKeySet
 
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, keySet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_locale

protected java.util.Locale m_locale
The locale to use.

Constructor Detail

CmsListResourceBundle

public CmsListResourceBundle()
Create a new list resource bundle for the XML.

Method Detail

addMessage

public void addMessage(java.lang.String key,
                       java.lang.String value)
Adds a message to this list bundle.

Please note: All additions after the initial call to getContents() are ignored.

Parameters:
key - the message key
value - the message itself

getClone

public CmsListResourceBundle getClone()
Returns a typed clone of this resource bundle.

This is required in order to make sure the objects in the permanent cache of the list based resource bundles which are usually read from the XML are never changed.

Returns:
a typed clone of this resource bundle

getContents

public java.lang.Object[][] getContents()
Specified by:
getContents in class java.util.ListResourceBundle
See Also:
ListResourceBundle.getContents()

getLocale

public java.util.Locale getLocale()
Overrides:
getLocale in class java.util.ResourceBundle
See Also:
ResourceBundle.getLocale()

setLocale

public void setLocale(java.util.Locale l)
Sets the locale used for this resource bundle.

Specified by:
setLocale in interface I_CmsResourceBundle
Parameters:
l - the locale to set

setParent

public void setParent(java.util.ResourceBundle p)
Description copied from interface: I_CmsResourceBundle
Sets the parent bundle.

Specified by:
setParent in interface I_CmsResourceBundle
Overrides:
setParent in class java.util.ResourceBundle
Parameters:
p - the parent bundle to set
See Also:
ResourceBundle.setParent(java.util.ResourceBundle)