Class DefaultLocaleProvider
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.converter.impl.DefaultLocaleProvider
-
- All Implemented Interfaces:
LocaleProvider
,java.io.Serializable
public class DefaultLocaleProvider extends java.lang.Object implements LocaleProvider
Default locale provider to be used inAbstractItemModel
. It wraps theI18NService
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultLocaleProvider(I18NService i18NService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Locale
getCurrentDataLocale()
Returns current (session) data locale to be used to read or store localized attribute data.java.util.List<java.util.Locale>
getFallbacks(java.util.Locale requested)
Returns aList
with fallbackLocale
s for the given Locale.boolean
isFallbackEnabled()
Returnstrue
if for the current session theLocale
fallback is enabled.protected I18NService
service()
java.util.Locale
toDataLocale(java.util.Locale external)
Converts a arbitrary locale instance into one which is allowed to read and write data with.
-
-
-
Constructor Detail
-
DefaultLocaleProvider
public DefaultLocaleProvider(I18NService i18NService)
-
-
Method Detail
-
service
protected I18NService service()
-
getCurrentDataLocale
public java.util.Locale getCurrentDataLocale()
Description copied from interface:LocaleProvider
Returns current (session) data locale to be used to read or store localized attribute data. May be other thanI18NService.getCurrentLocale()
!- Specified by:
getCurrentDataLocale
in interfaceLocaleProvider
-
toDataLocale
public java.util.Locale toDataLocale(java.util.Locale external)
Description copied from interface:LocaleProvider
Converts a arbitrary locale instance into one which is allowed to read and write data with.- Specified by:
toDataLocale
in interfaceLocaleProvider
- Parameters:
external
- the locale
-
getFallbacks
public java.util.List<java.util.Locale> getFallbacks(java.util.Locale requested)
Description copied from interface:LocaleProvider
Returns aList
with fallbackLocale
s for the given Locale.- Specified by:
getFallbacks
in interfaceLocaleProvider
- Parameters:
requested
- the Locale for which all fallback Locales are requested.- Returns:
null
if the locale fallback is not enabled (seeLocaleProvider.isFallbackEnabled()
).
-
isFallbackEnabled
public boolean isFallbackEnabled()
Description copied from interface:LocaleProvider
Returnstrue
if for the current session theLocale
fallback is enabled.- Specified by:
isFallbackEnabled
in interfaceLocaleProvider
- Returns:
false
otherwise.
-
-