Package com.ibm.icu.impl
Class ICULocaleService
- java.lang.Object
-
- com.ibm.icu.impl.ICUNotifier
-
- com.ibm.icu.impl.ICUService
-
- com.ibm.icu.impl.ICULocaleService
-
- Direct Known Subclasses:
BreakIteratorFactory.BFService
,CollatorServiceShim.CService
,CurrencyServiceShim.CFService
,NumberFormatServiceShim.NFService
public class ICULocaleService extends ICUService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ICULocaleService.ICUResourceBundleFactory
A LocaleKeyFactory that creates a service based on the ICU locale data.static class
ICULocaleService.LocaleKey
A subclass of Key that implements a locale fallback mechanism.static class
ICULocaleService.LocaleKeyFactory
A subclass of Factory that uses LocaleKeys.static class
ICULocaleService.SimpleLocaleKeyFactory
A LocaleKeyFactory that just returns a single object for a kind/locale.-
Nested classes/interfaces inherited from class com.ibm.icu.impl.ICUService
ICUService.Factory, ICUService.Key, ICUService.ServiceListener, ICUService.SimpleFactory
-
-
Field Summary
Fields Modifier and Type Field Description private ULocale
fallbackLocale
private java.lang.String
fallbackLocaleName
-
Fields inherited from class com.ibm.icu.impl.ICUService
name
-
-
Constructor Summary
Constructors Constructor Description ICULocaleService()
Construct an ICULocaleService.ICULocaleService(java.lang.String name)
Construct an ICULocaleService with a name (useful for debugging).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ICUService.Key
createKey(ULocale l, int kind)
ICUService.Key
createKey(java.lang.String id)
Create a key from an id.ICUService.Key
createKey(java.lang.String id, int kind)
java.lang.Object
get(ULocale locale)
Convenience override for callers using locales.java.lang.Object
get(ULocale locale, int kind)
Convenience override for callers using locales.java.lang.Object
get(ULocale locale, int kind, ULocale[] actualReturn)
Convenience override for callers using locales.java.lang.Object
get(ULocale locale, ULocale[] actualReturn)
Convenience override for callers using locales.java.util.Locale[]
getAvailableLocales()
Convenience method for callers using locales.ULocale[]
getAvailableULocales()
Convenience method for callers using locales.ICUService.Factory
registerObject(java.lang.Object obj, ULocale locale)
Convenience override for callers using locales.ICUService.Factory
registerObject(java.lang.Object obj, ULocale locale, boolean visible)
Convenience override for callers using locales.ICUService.Factory
registerObject(java.lang.Object obj, ULocale locale, int kind)
Convenience function for callers using locales.ICUService.Factory
registerObject(java.lang.Object obj, ULocale locale, int kind, boolean visible)
Convenience function for callers using locales.java.lang.String
validateFallbackLocale()
Return the name of the current fallback locale.-
Methods inherited from class com.ibm.icu.impl.ICUService
acceptsListener, clearCaches, clearServiceCache, factories, get, get, getDisplayName, getDisplayName, getDisplayNames, getDisplayNames, getDisplayNames, getDisplayNames, getDisplayNames, getKey, getKey, getKey, getName, getVisibleIDs, getVisibleIDs, handleDefault, isDefault, markDefault, notifyListener, registerFactory, registerObject, registerObject, reInitializeFactories, reset, stats, toString, unregisterFactory
-
Methods inherited from class com.ibm.icu.impl.ICUNotifier
addListener, notifyChanged, removeListener
-
-
-
-
Field Detail
-
fallbackLocale
private ULocale fallbackLocale
-
fallbackLocaleName
private java.lang.String fallbackLocaleName
-
-
Method Detail
-
get
public java.lang.Object get(ULocale locale)
Convenience override for callers using locales. This calls get(ULocale, int, ULocale[]) with KIND_ANY for kind and null for actualReturn.
-
get
public java.lang.Object get(ULocale locale, int kind)
Convenience override for callers using locales. This calls get(ULocale, int, ULocale[]) with a null actualReturn.
-
get
public java.lang.Object get(ULocale locale, ULocale[] actualReturn)
Convenience override for callers using locales. This calls get(ULocale, int, ULocale[]) with KIND_ANY for kind.
-
get
public java.lang.Object get(ULocale locale, int kind, ULocale[] actualReturn)
Convenience override for callers using locales. This uses createKey(ULocale.toString(), kind) to create a key, calls getKey, and then if actualReturn is not null, returns the actualResult from getKey (stripping any prefix) into a ULocale.
-
registerObject
public ICUService.Factory registerObject(java.lang.Object obj, ULocale locale)
Convenience override for callers using locales. This calls registerObject(Object, ULocale, int kind, boolean visible) passing KIND_ANY for the kind, and true for the visibility.
-
registerObject
public ICUService.Factory registerObject(java.lang.Object obj, ULocale locale, boolean visible)
Convenience override for callers using locales. This calls registerObject(Object, ULocale, int kind, boolean visible) passing KIND_ANY for the kind.
-
registerObject
public ICUService.Factory registerObject(java.lang.Object obj, ULocale locale, int kind)
Convenience function for callers using locales. This calls registerObject(Object, ULocale, int kind, boolean visible) passing true for the visibility.
-
registerObject
public ICUService.Factory registerObject(java.lang.Object obj, ULocale locale, int kind, boolean visible)
Convenience function for callers using locales. This instantiates a SimpleLocaleKeyFactory, and registers the factory.
-
getAvailableLocales
public java.util.Locale[] getAvailableLocales()
Convenience method for callers using locales. This returns the standard Locale list, built from the Set of visible ids.
-
getAvailableULocales
public ULocale[] getAvailableULocales()
Convenience method for callers using locales. This returns the standard ULocale list, built from the Set of visible ids.
-
validateFallbackLocale
public java.lang.String validateFallbackLocale()
Return the name of the current fallback locale. If it has changed since this was last accessed, the service cache is cleared.
-
createKey
public ICUService.Key createKey(java.lang.String id)
Description copied from class:ICUService
Create a key from an id. This creates a Key instance. Subclasses can override to define more useful keys appropriate to the factories they accept. If id is null, returns null.- Overrides:
createKey
in classICUService
-
createKey
public ICUService.Key createKey(java.lang.String id, int kind)
-
createKey
public ICUService.Key createKey(ULocale l, int kind)
-
-