| Modifier and Type | Class and Description |
|---|---|
| public static class | ICULocaleService.ICUResourceBundleFactory
A LocaleKeyFactory that creates a service based on the ICU locale data. |
| public static class | ICULocaleService.LocaleKey
A subclass of Key that implements a locale fallback mechanism. |
| public abstract static class | ICULocaleService.LocaleKeyFactory
A subclass of Factory that uses LocaleKeys. |
| public static class | ICULocaleService.SimpleLocaleKeyFactory
A LocaleKeyFactory that just returns a single object for a kind/locale. |
| Modifier and Type | Field and Description |
|---|---|
| private ULocale | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ICUService. | createKey(String id)
Overrides com. |
| public ICUService. | |
| public ICUService. | |
| public Object | |
| public Object | |
| public Object | |
| public Object | |
| public Locale[] | |
| public ULocale[] | |
| public ICUService. | |
| public ICUService. | registerObject(Object obj, ULocale locale, boolean visible)
Convenience override for callers using locales. |
| public ICUService. | |
| public ICUService. | registerObject(Object obj, ULocale locale, int kind, boolean visible)
Convenience function for callers using locales. |
| public String |
| fallbackLocale | back to summary |
|---|---|
| private ULocale fallbackLocale | |
| fallbackLocaleName | back to summary |
|---|---|
| private String fallbackLocaleName | |
| ICULocaleService | back to summary |
|---|---|
| public ICULocaleService() Construct an ICULocaleService. | |
| ICULocaleService | back to summary |
|---|---|
| public ICULocaleService(String name) Construct an ICULocaleService with a name (useful for debugging). | |
| createKey | back to summary |
|---|---|
| public ICUService. Overrides com. Doc from com. 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.
| |
| createKey | back to summary |
|---|---|
| public ICUService. | |
| createKey | back to summary |
|---|---|
| public ICUService. | |
| get | back to summary |
|---|---|
| public 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 | back to summary |
|---|---|
| public Object get(ULocale locale, int kind) Convenience override for callers using locales. This calls get(ULocale, int, ULocale[]) with a null actualReturn. | |
| get | back to summary |
|---|---|
| public Object get(ULocale locale, ULocale[] actualReturn) Convenience override for callers using locales. This calls get(ULocale, int, ULocale[]) with KIND_ANY for kind. | |
| get | back to summary |
|---|---|
| public 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. | |
| getAvailableLocales | back to summary |
|---|---|
| public Locale[] getAvailableLocales() Convenience method for callers using locales. This returns the standard Locale list, built from the Set of visible ids. | |
| getAvailableULocales | back to summary |
|---|---|
| public ULocale[] getAvailableULocales() Convenience method for callers using locales. This returns the standard ULocale list, built from the Set of visible ids. | |
| registerObject | back to summary |
|---|---|
| public ICUService. 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 | back to summary |
|---|---|
| public ICUService. Convenience override for callers using locales. This calls registerObject(Object, ULocale, int kind, boolean visible) passing KIND_ANY for the kind. | |
| registerObject | back to summary |
|---|---|
| public ICUService. Convenience function for callers using locales. This calls registerObject(Object, ULocale, int kind, boolean visible) passing true for the visibility. | |
| registerObject | back to summary |
|---|---|
| public ICUService. Convenience function for callers using locales. This instantiates a SimpleLocaleKeyFactory, and registers the factory. | |
| validateFallbackLocale | back to summary |
|---|---|
| public String validateFallbackLocale() Return the name of the current fallback locale. If it has changed since this was last accessed, the service cache is cleared. | |
| Modifier and Type | Field and Description |
|---|---|
| protected final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ICUResourceBundleFactory(String bundleName)
A service factory based on ICU resource data in resources with the given name. |
| Modifier and Type | Method and Description |
|---|---|
| protected Set | getSupportedIDs()
Overrides com. |
| protected Object | handleCreate(ULocale loc, int kind, ICUService service)
Overrides com. |
| protected ClassLoader | |
| public String | |
| public void | updateVisibleIDs(Map<String, ICUService.
Overrides com. Implements com. |
| bundleName | back to summary |
|---|---|
| protected final String bundleName | |
| ICUResourceBundleFactory | back to summary |
|---|---|
| public ICUResourceBundleFactory() Convenience constructor that uses the main ICU bundle name. | |
| ICUResourceBundleFactory | back to summary |
|---|---|
| public ICUResourceBundleFactory(String bundleName) A service factory based on ICU resource data in resources with the given name. | |
| getSupportedIDs | back to summary |
|---|---|
| protected Set Overrides com. Return the supported IDs. This is the set of all locale names for the bundleName.
| |
| handleCreate | back to summary |
|---|---|
| protected Object handleCreate(ULocale loc, int kind, ICUService service) Overrides com. Create the service. The default implementation returns the resource bundle for the locale, ignoring kind, and service.
| |
| loader | back to summary |
|---|---|
| protected ClassLoader loader() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from com. For debugging.
| |
| updateVisibleIDs | back to summary |
|---|---|
| public void updateVisibleIDs(Map<String, ICUService. Overrides com. Implements com. Override of superclass method.
| |
Canonicalization adjusts the locale string so that the section before the first understore is in lower case, and the rest is in upper case, with no trailing underscores.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private String | |
| private int | |
| public static final int | |
| private String | |
| private int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public String | canonicalID()
Overrides com. |
| public ULocale | canonicalLocale()
Convenience method to return the locale corresponding to the (canonical) original ID. |
| public static ICULocaleService. | createWithCanonical(ULocale locale, String canonicalFallbackID, int kind)
Create a LocaleKey with canonical primary and fallback IDs. |
| public static ICULocaleService. | createWithCanonicalFallback(String primaryID, String canonicalFallbackID)
Create a LocaleKey with canonical primary and fallback IDs. |
| public static ICULocaleService. | createWithCanonicalFallback(String primaryID, String canonicalFallbackID, int kind)
Create a LocaleKey with canonical primary and fallback IDs. |
| public String | currentDescriptor()
Overrides com. |
| public String | currentID()
Overrides com. |
| public ULocale | |
| public boolean | fallback()
Overrides com. |
| public boolean | isFallbackOf(String id)
Overrides com. |
| public int | |
| public String |
| currentID | back to summary |
|---|---|
| private String currentID | |
| fallbackID | back to summary |
|---|---|
| private String fallbackID | |
| kind | back to summary |
|---|---|
| private int kind | |
| KIND_ANY | back to summary |
|---|---|
| public static final int KIND_ANY | |
| primaryID | back to summary |
|---|---|
| private String primaryID | |
| varstart | back to summary |
|---|---|
| private int varstart | |
| LocaleKey | back to summary |
|---|---|
| protected LocaleKey(String primaryID, String canonicalPrimaryID, String canonicalFallbackID, int kind) PrimaryID is the user's requested locale string, canonicalPrimaryID is this string in canonical form, fallbackID is the current default locale's string in canonical form. | |
| canonicalID | back to summary |
|---|---|
| public String canonicalID() Overrides com. Return the (canonical) original ID.
| |
| canonicalLocale | back to summary |
|---|---|
| public ULocale canonicalLocale() Convenience method to return the locale corresponding to the (canonical) original ID. | |
| createWithCanonical | back to summary |
|---|---|
| public static ICULocaleService. Create a LocaleKey with canonical primary and fallback IDs. | |
| createWithCanonicalFallback | back to summary |
|---|---|
| public static ICULocaleService. Create a LocaleKey with canonical primary and fallback IDs. | |
| createWithCanonicalFallback | back to summary |
|---|---|
| public static ICULocaleService. Create a LocaleKey with canonical primary and fallback IDs. | |
| currentDescriptor | back to summary |
|---|---|
| public String currentDescriptor() Overrides com. Return the (canonical) current descriptor, or null if no current id. Includes the keywords, whereas the ID does not include keywords.
| |
| currentID | back to summary |
|---|---|
| public String currentID() Overrides com. Return the (canonical) current ID, or null if no current id.
| |
| currentLocale | back to summary |
|---|---|
| public ULocale currentLocale() Convenience method to return the ulocale corresponding to the (canonical) currentID. | |
| fallback | back to summary |
|---|---|
| public boolean fallback() Overrides com. If the key has a fallback, modify the key and return true, otherwise return false. First falls back through the primary ID, then through the fallbackID. The final fallback is "" (root) unless the primary id was "" (root), in which case there is no fallback.
| |
| isFallbackOf | back to summary |
|---|---|
| public boolean isFallbackOf(String id) Overrides com. If a key created from id would eventually fallback to match the canonical ID of this key, return true.
| |
| kind | back to summary |
|---|---|
| public int kind() Return the kind code associated with this key. | |
| prefix | back to summary |
|---|---|
| public String prefix() Return the prefix associated with the kind, or null if the kind is KIND_ANY. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final boolean | |
| protected final String | |
| protected final boolean | |
| public static final boolean |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Object | create(ICUService.
Implements com. |
| public String | getDisplayName(String id, ULocale locale)
Implements com. |
| protected Set | |
| protected Object | handleCreate(ULocale loc, int kind, ICUService service)
Utility method used by create(Key, ICUService). |
| protected boolean | |
| protected boolean | |
| public String | |
| public void | updateVisibleIDs(Map<String, ICUService.
Implements com. |
| INVISIBLE | back to summary |
|---|---|
| public static final boolean INVISIBLE | |
| name | back to summary |
|---|---|
| protected final String name | |
| visible | back to summary |
|---|---|
| protected final boolean visible | |
| VISIBLE | back to summary |
|---|---|
| public static final boolean VISIBLE | |
| LocaleKeyFactory | back to summary |
|---|---|
| protected LocaleKeyFactory(boolean visible) Constructor used by subclasses. | |
| LocaleKeyFactory | back to summary |
|---|---|
| protected LocaleKeyFactory(boolean visible, String name) Constructor used by subclasses. | |
| create | back to summary |
|---|---|
| public Object create(ICUService. Implements com. Implement superclass abstract method. This checks the currentID of the key against the supported IDs, and passes the canonicalLocale and kind off to handleCreate (which subclasses must implement).
| |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName(String id, ULocale locale) Implements com. Return a localized name for the locale represented by id.
| |
| getSupportedIDs | back to summary |
|---|---|
| protected Set Return the set of ids that this factory supports (visible or otherwise). This can be called often and might need to be cached if it is expensive to create. | |
| handleCreate | back to summary |
|---|---|
| protected Object handleCreate(ULocale loc, int kind, ICUService service) Utility method used by create(Key, ICUService). Subclasses can implement this instead of create. | |
| handlesKey | back to summary |
|---|---|
| protected boolean handlesKey(ICUService. | |
| isSupportedID | back to summary |
|---|---|
| protected boolean isSupportedID(String id) Return true if this id is one the factory supports (visible or otherwise). | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. For debugging.
| |
| updateVisibleIDs | back to summary |
|---|---|
| public void updateVisibleIDs(Map<String, ICUService. Implements com. Override of superclass method.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final int | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | create(ICUService.
Overrides com. Implements com. |
| protected boolean | isSupportedID(String idToCheck)
Overrides com. |
| public String | |
| public void | updateVisibleIDs(Map<String, ICUService.
Overrides com. Implements com. |
| id | back to summary |
|---|---|
| private final String id | |
| kind | back to summary |
|---|---|
| private final int kind | |
| obj | back to summary |
|---|---|
| private final Object obj | |
| SimpleLocaleKeyFactory | back to summary |
|---|---|
| public SimpleLocaleKeyFactory(Object obj, ULocale locale, int kind, boolean visible) | |
| SimpleLocaleKeyFactory | back to summary |
|---|---|
| public SimpleLocaleKeyFactory(Object obj, ULocale locale, int kind, boolean visible, String name) | |
| create | back to summary |
|---|---|
| public Object create(ICUService. Overrides com. Implements com. Returns the service object if kind/locale match. Service is not used.
| |
| isSupportedID | back to summary |
|---|---|
| protected boolean isSupportedID(String idToCheck) Overrides com. Doc from com. Return true if this id is one the factory supports (visible or otherwise).
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from com. For debugging.
| |
| updateVisibleIDs | back to summary |
|---|---|
| public void updateVisibleIDs(Map<String, ICUService. Overrides com. Implements com. Doc from com. Override of superclass method.
| |