Package org.opencms.i18n
Class CmsReplaceMessageKeyPrefix
- java.lang.Object
-
- org.opencms.i18n.CmsReplaceMessageKeyPrefix
-
- All Implemented Interfaces:
CmsMultiMessages.I_KeyFallbackHandler
public class CmsReplaceMessageKeyPrefix extends java.lang.Object implements CmsMultiMessages.I_KeyFallbackHandler
Message key fallback handler which replaces a given set of prefixes with alternative prefixes.
-
-
Constructor Summary
Constructors Constructor Description CmsReplaceMessageKeyPrefix(java.lang.String configuration)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.base.Optional<java.lang.String>
getFallbackKey(java.lang.String key)
Gets the fallback key for the given key, or the absent value if there is no fallback key.
-
-
-
Constructor Detail
-
CmsReplaceMessageKeyPrefix
public CmsReplaceMessageKeyPrefix(java.lang.String configuration)
Creates a new instance.- Parameters:
configuration
- a pipe-separated list of colon-separated key-value pairs, where the key is the prefix and the value is the replacement
-
-
Method Detail
-
getFallbackKey
public com.google.common.base.Optional<java.lang.String> getFallbackKey(java.lang.String key)
Description copied from interface:CmsMultiMessages.I_KeyFallbackHandler
Gets the fallback key for the given key, or the absent value if there is no fallback key.- Specified by:
getFallbackKey
in interfaceCmsMultiMessages.I_KeyFallbackHandler
- Parameters:
key
- the original key- Returns:
- the fallback key
- See Also:
CmsMultiMessages.I_KeyFallbackHandler.getFallbackKey(java.lang.String)
-
-