|
Java SDK r12.5 SP 8 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.netegrity.ims.util.Localizer
public class Localizer
Helper class for retrieving the localized version of a string for a given locale.
The localized string is assigned to a unique property ID in a resource bundle. You pass the property ID to the method that retrieves the localized string.getLocalizedString()
to have Identity Manager search through all localized elements for the specified property.
getConditionallyLocalizedString()
to have Identity Manager search through and retrieve localized task screen labels only.
Method Summary | |
---|---|
static java.lang.String |
getBaseName()
Deprecated. Deprecated in Identity Manager 8.1. Use getBundleName() or
getDefaultBundleName() . |
java.lang.String |
getBundleName()
Retrieves the bundle name for this Localizer instance. |
java.lang.String |
getConditionallyLocalizedString(java.lang.String property)
Retrieves the localized string that is mapped to the specified property, provided that the property refers to a label on a task screen. |
static java.lang.String |
getDefaultBundleName()
Retrieves the default bundle name used for all Localizer
instances that do not specify a bundle. |
java.lang.String |
getFormattedString(java.lang.String property,
java.lang.Object[] messageArgs)
Retrieves the localized string with parameters replaced by specified arguments. |
static Localizer |
getInstance()
Retrieves an instance of a Localizer object for the current locale and default bundle name. |
static Localizer |
getInstance(java.util.Locale locale)
Retrieves an instance of a Localizer object for the specified locale and default bundle name. |
static Localizer |
getInstance(java.util.Locale locale,
java.lang.String bundleName)
Retrieves an instance of a Localizer object for the specified
Locale and bundle name. |
static Localizer |
getInstance(java.lang.String bundleName)
Retrieves an instance of a Localizer object for the current locale and
the specified bundle name. |
java.util.Locale |
getLocale()
Retrieves a Java Locale object. |
java.lang.String |
getLocalizedString(java.lang.String property)
Retrieves the localized string that is mapped to the specified property. |
static java.util.Locale |
getThreadLocale()
Retrieves the locale for the currently executing thread. |
static void |
removeThreadLocale()
Removes the locale for the currently executing thread. |
static void |
setThreadLocale(java.util.Locale locale)
Sets the locale for the currently executing thread. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Localizer getInstance()
Localizer
object for the current locale and default bundle name.
Localizer
instance for the current locale and default bundle name.public static Localizer getInstance(java.lang.String bundleName)
Localizer
object for the current locale and
the specified bundle name.
bundleName
- The base bundle name to use for this Localizer
instance.
Localizer
instance for the current locale and specified bundle name.public static Localizer getInstance(java.util.Locale locale)
Localizer
object for the specified locale and default bundle name.
locale
- The Locale
to use for this Localizer
instance.
Localizer
instance for the specified locale and default bundle name.public static Localizer getInstance(java.util.Locale locale, java.lang.String bundleName)
Retrieves an instance of a Localizer
object for the specified
Locale
and bundle name.
IMSResources
bundles are provided with Identity Manager.
Localizer
instance for the specified locale and bundle name.public java.lang.String getLocalizedString(java.lang.String property) throws IMSException
Retrieves the localized string that is mapped to the specified property.
The property can refer to any localized element, such as a label on a task screen,
a task name, or an exception message.
The mapping takes place in the resource bundle associated with the current locale.
property
- The unique ID that is mapped to the string to retrieve.
property
.
IMSException
public java.lang.String getFormattedString(java.lang.String property, java.lang.Object[] messageArgs) throws IMSException
property
- The unique key that is mapped to the string to retrievemessageArgs
- Arrray of arguments for parametric replacement
IMSException
public java.lang.String getConditionallyLocalizedString(java.lang.String property) throws IMSException
imstask.label
.
The mapping takes place in the resource bundle associated with the current locale.
property
- The unique ID that is mapped to the label to retrieve.
The property value must include the prefix
imstask.label
.
property
.
If the specified property can't be found, the method returns the
value passed in property
.
IMSException
public java.util.Locale getLocale()
Locale
object.
Locale
object.public java.lang.String getBundleName()
Localizer
instance.
public static java.lang.String getDefaultBundleName()
Localizer
instances that do not specify a bundle.
public static java.lang.String getBaseName()
getBundleName()
or
getDefaultBundleName()
.
This method is deprecated in Identity Manager 8.1 -- bundles are now specified per localizer instance.
The deprecatedgetBaseName()
returns the DEFAULT bundle
name of IMSResources
(the bundle provided with Identity Manager).
Use one of the following methods instead:
Localizer
instance,
call the non-static getBundleName()
.
getDefaultBundleName()
.
IMSResources
.public static void setThreadLocale(java.util.Locale locale)
locale
- The locale to use for the currently executing thread.public static void removeThreadLocale()
public static java.util.Locale getThreadLocale()
|
Java SDK r12.5 SP 8 06/13/2011 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |