Package com.ibm.icu.impl
Interface ICUService.Factory
- All Known Implementing Classes:
ICULocaleService.ICUResourceBundleFactory
,ICULocaleService.LocaleKeyFactory
,ICULocaleService.SimpleLocaleKeyFactory
,ICUService.SimpleFactory
,NumberFormatServiceShim.NFFactory
- Enclosing class:
- ICUService
public static interface ICUService.Factory
Factories generate the service objects maintained by the
service. A factory generates a service object from a key,
updates id->factory mappings, and returns the display name for
a supported id.
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(ICUService.Key key, ICUService service) Create a service object from the key, if this factory supports the key.getDisplayName
(String id, ULocale locale) Return the display name for this id in the provided locale.void
updateVisibleIDs
(Map<String, ICUService.Factory> result) Update the result IDs (not descriptors) to reflect the IDs this factory handles.
-
Method Details
-
create
Create a service object from the key, if this factory supports the key. Otherwise, return null.If the factory supports the key, then it can call the service's getKey(Key, String[], Factory) method passing itself as the factory to get the object that the service would have created prior to the factory's registration with the service. This can change the key, so any information required from the key should be extracted before making such a callback.
-
updateVisibleIDs
Update the result IDs (not descriptors) to reflect the IDs this factory handles. This function and getDisplayName are used to support ICUService.getDisplayNames. Basically, the factory has to determine which IDs it will permit to be available, and of those, which it will provide localized display names for. In most cases this reflects the IDs that the factory directly supports. -
getDisplayName
Return the display name for this id in the provided locale. This is an localized id, not a descriptor. If the id is not visible or not defined by the factory, return null. If locale is null, return id unchanged.
-