Package org.opencms.i18n
Class CmsVfsResourceBundle
- java.lang.Object
-
- java.util.ResourceBundle
-
- org.opencms.i18n.CmsVfsResourceBundle
-
- All Implemented Interfaces:
I_CmsResourceBundle
public class CmsVfsResourceBundle extends java.util.ResourceBundle implements I_CmsResourceBundle
Resource bundle which loads its data from a VFS resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CmsVfsResourceBundle.I_Loader
Implementors of this interface are responsible for actually loading the data from the VFS.
-
Field Summary
Fields Modifier and Type Field Description protected static CmsObject
m_cms
The CMS context to use.protected CmsVfsResourceBundle.I_Loader
m_loader
The bundle loader instance to use.protected CmsVfsBundleParameters
m_parameters
The VFS bundle parameters.static java.lang.String
TYPE_PROPERTIES
Name constant for the 'properties' vfs bundle type.static java.lang.String
TYPE_XML
Name constant for the 'xml content' vfs bundle type.
-
Constructor Summary
Constructors Constructor Description CmsVfsResourceBundle(CmsVfsBundleParameters params)
Creates a new VFS bundle instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsVfsResourceBundle
getClone()
Creates a clone of the resource bundle.protected java.lang.String
getFilePath()
Returns the path of the file to read the message data from.java.util.Enumeration<java.lang.String>
getKeys()
java.util.Locale
getLocale()
CmsVfsBundleParameters
getParameters()
Gets the bundle parameters.protected java.lang.Object
handleGetObject(java.lang.String key)
protected java.util.Set<java.lang.String>
handleKeySet()
static void
setCmsObject(CmsObject cms)
Sets the CMS context used by this class.void
setLocale(java.util.Locale locale)
Sets the locale used for this resource bundle.void
setParent(java.util.ResourceBundle p)
Sets the parent bundle.
-
-
-
Field Detail
-
TYPE_PROPERTIES
public static final java.lang.String TYPE_PROPERTIES
Name constant for the 'properties' vfs bundle type.- See Also:
- Constant Field Values
-
TYPE_XML
public static final java.lang.String TYPE_XML
Name constant for the 'xml content' vfs bundle type.- See Also:
- Constant Field Values
-
m_loader
protected CmsVfsResourceBundle.I_Loader m_loader
The bundle loader instance to use.
-
m_parameters
protected CmsVfsBundleParameters m_parameters
The VFS bundle parameters.
-
-
Constructor Detail
-
CmsVfsResourceBundle
public CmsVfsResourceBundle(CmsVfsBundleParameters params)
Creates a new VFS bundle instance.- Parameters:
params
- the VFS bundle parameters
-
-
Method Detail
-
setCmsObject
public static void setCmsObject(CmsObject cms)
Sets the CMS context used by this class.This can be never called more than once, and is usually called on startup.
- Parameters:
cms
- the CMS context to set
-
getClone
public CmsVfsResourceBundle getClone()
Description copied from interface:I_CmsResourceBundle
Creates a clone of the resource bundle.(This may not actually clone the resource bundle if it is immutable).
- Specified by:
getClone
in interfaceI_CmsResourceBundle
- Returns:
- a clone of the resource bundle
- See Also:
I_CmsResourceBundle.getClone()
-
getKeys
public java.util.Enumeration<java.lang.String> getKeys()
- Specified by:
getKeys
in classjava.util.ResourceBundle
- See Also:
ResourceBundle.getKeys()
-
getLocale
public java.util.Locale getLocale()
- Overrides:
getLocale
in classjava.util.ResourceBundle
- See Also:
ResourceBundle.getLocale()
-
getParameters
public CmsVfsBundleParameters getParameters()
Gets the bundle parameters.- Returns:
- the bundle parameters
-
setLocale
public void setLocale(java.util.Locale locale)
Description copied from interface:I_CmsResourceBundle
Sets the locale used for this resource bundle.- Specified by:
setLocale
in interfaceI_CmsResourceBundle
- Parameters:
locale
- the locale to set- See Also:
I_CmsResourceBundle.setLocale(java.util.Locale)
-
setParent
public void setParent(java.util.ResourceBundle p)
Description copied from interface:I_CmsResourceBundle
Sets the parent bundle.- Specified by:
setParent
in interfaceI_CmsResourceBundle
- Overrides:
setParent
in classjava.util.ResourceBundle
- Parameters:
p
- the parent bundle to set- See Also:
ResourceBundle.setParent(java.util.ResourceBundle)
-
getFilePath
protected java.lang.String getFilePath()
Returns the path of the file to read the message data from.- Returns:
- the root path of the file containing the message data
-
handleGetObject
protected java.lang.Object handleGetObject(java.lang.String key)
- Specified by:
handleGetObject
in classjava.util.ResourceBundle
- See Also:
ResourceBundle.handleGetObject(java.lang.String)
-
handleKeySet
protected java.util.Set<java.lang.String> handleKeySet()
- Overrides:
handleKeySet
in classjava.util.ResourceBundle
- See Also:
ResourceBundle.handleKeySet()
-
-