Interface LocaleProvider
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
DefaultLocaleProvider
,StubLocaleProvider
public interface LocaleProvider extends java.io.Serializable
Provides access to current localization qualifier to be used insideAbstractItemModel
.
-
-
Method Summary
All Methods Instance Methods Abstract 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 requestedLocale)
Returns aList
with fallbackLocale
s for the given Locale.boolean
isFallbackEnabled()
Returnstrue
if for the current session theLocale
fallback is enabled.java.util.Locale
toDataLocale(java.util.Locale external)
Converts a arbitrary locale instance into one which is allowed to read and write data with.
-
-
-
Method Detail
-
getCurrentDataLocale
java.util.Locale getCurrentDataLocale()
Returns current (session) data locale to be used to read or store localized attribute data. May be other thanI18NService.getCurrentLocale()
!
-
toDataLocale
java.util.Locale toDataLocale(java.util.Locale external)
Converts a arbitrary locale instance into one which is allowed to read and write data with.- Parameters:
external
- the locale- Throws:
java.lang.IllegalArgumentException
- if no supported data locale could be found
-
isFallbackEnabled
boolean isFallbackEnabled()
Returnstrue
if for the current session theLocale
fallback is enabled.- Returns:
false
otherwise.
-
getFallbacks
java.util.List<java.util.Locale> getFallbacks(java.util.Locale requestedLocale)
Returns aList
with fallbackLocale
s for the given Locale.- Parameters:
requestedLocale
- the Locale for which all fallback Locales are requested.- Returns:
null
if the locale fallback is not enabled (seeisFallbackEnabled()
).
-
-