Package com.ibm.icu.impl
Class ICULocaleService.LocaleKeyFactory
- java.lang.Object
-
- com.ibm.icu.impl.ICULocaleService.LocaleKeyFactory
-
- All Implemented Interfaces:
ICUService.Factory
- Direct Known Subclasses:
ICULocaleService.ICUResourceBundleFactory
,ICULocaleService.SimpleLocaleKeyFactory
,NumberFormatServiceShim.NFFactory
- Enclosing class:
- ICULocaleService
public abstract static class ICULocaleService.LocaleKeyFactory extends java.lang.Object implements ICUService.Factory
A subclass of Factory that uses LocaleKeys. If 'visible' the factory reports its IDs.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LocaleKeyFactory(boolean visible)
Constructor used by subclasses.protected
LocaleKeyFactory(boolean visible, java.lang.String name)
Constructor used by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
create(ICUService.Key key, ICUService service)
Implement superclass abstract method.java.lang.String
getDisplayName(java.lang.String id, ULocale locale)
Return a localized name for the locale represented by id.protected java.util.Set<java.lang.String>
getSupportedIDs()
Return the set of ids that this factory supports (visible or otherwise).protected java.lang.Object
handleCreate(ULocale loc, int kind, ICUService service)
Utility method used by create(Key, ICUService).protected boolean
handlesKey(ICUService.Key key)
protected boolean
isSupportedID(java.lang.String id)
Return true if this id is one the factory supports (visible or otherwise).java.lang.String
toString()
For debugging.void
updateVisibleIDs(java.util.Map<java.lang.String,ICUService.Factory> result)
Override of superclass method.
-
-
-
Field Detail
-
name
protected final java.lang.String name
-
visible
protected final boolean visible
-
VISIBLE
public static final boolean VISIBLE
- See Also:
- Constant Field Values
-
INVISIBLE
public static final boolean INVISIBLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public java.lang.Object create(ICUService.Key key, ICUService service)
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).- Specified by:
create
in interfaceICUService.Factory
-
handlesKey
protected boolean handlesKey(ICUService.Key key)
-
updateVisibleIDs
public void updateVisibleIDs(java.util.Map<java.lang.String,ICUService.Factory> result)
Override of superclass method.- Specified by:
updateVisibleIDs
in interfaceICUService.Factory
-
getDisplayName
public java.lang.String getDisplayName(java.lang.String id, ULocale locale)
Return a localized name for the locale represented by id.- Specified by:
getDisplayName
in interfaceICUService.Factory
-
handleCreate
protected java.lang.Object handleCreate(ULocale loc, int kind, ICUService service)
Utility method used by create(Key, ICUService). Subclasses can implement this instead of create.
-
isSupportedID
protected boolean isSupportedID(java.lang.String id)
Return true if this id is one the factory supports (visible or otherwise).
-
getSupportedIDs
protected java.util.Set<java.lang.String> getSupportedIDs()
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.
-
toString
public java.lang.String toString()
For debugging.- Overrides:
toString
in classjava.lang.Object
-
-