Package org.opencms.i18n
Class CmsMessageToBundleIndex
- java.lang.Object
-
- org.opencms.i18n.CmsMessageToBundleIndex
-
public class CmsMessageToBundleIndex extends java.lang.Object
A lookup table used to find out which VFS based message bundles (XML/property bundles) contain a given key.
-
-
Constructor Summary
Constructors Constructor Description CmsMessageToBundleIndex(java.util.Collection<java.lang.String> bundleNames, java.util.Locale locale)
Creates a new instance that will read its data from a given set of bundles.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBundlePathForKey(java.lang.String key)
Gets the root path of the bundle file for the given message key.static CmsMessageToBundleIndex
read(CmsObject cms)
Reads the bundle information for the whole system.
-
-
-
Constructor Detail
-
CmsMessageToBundleIndex
public CmsMessageToBundleIndex(java.util.Collection<java.lang.String> bundleNames, java.util.Locale locale)
Creates a new instance that will read its data from a given set of bundles.- Parameters:
bundleNames
- the set of bundle names from which to read the informationlocale
- the locale to use
-
-
Method Detail
-
read
public static CmsMessageToBundleIndex read(CmsObject cms) throws CmsException
Reads the bundle information for the whole system.This uses the request context locale of the CmsObject passed as an argument.
- Parameters:
cms
- the CMS context to use- Returns:
- the bundle information
- Throws:
CmsException
- if something goes wrong
-
getBundlePathForKey
public java.lang.String getBundlePathForKey(java.lang.String key)
Gets the root path of the bundle file for the given message key.If no bundle is found, null is returned.
- Parameters:
key
- the message key- Returns:
- the bundle root path
-
-