Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.common
Class Localizer

    java.lang.Object
      oracle.ifs.common.Localizer

All Implemented Interfaces:
  java.io.Serializable

    public final class Localizer

extends java.lang.Object
implements java.io.Serializable

A Localizer encapsulates internationalization information.

Many methods in the iFS API require internationalization information, such as the appropriate locale, date format, time format, or number format. This data is encapsulated in a Localizer instance, which is made available to such methods.

Each LibrarySession has a Localizer based on arguments supplied to `LibraryService.connect`.

A Localizer also encapsulates the iFS resource bundle. The `getResourceString` methods of LibrarySession and LibraryObject use this resource bundle to generate localized messages. An application can override some or all of these messages, or introduce its own messages, by invoking `setExtendedResourceBundles` on the Localizer returned by `LibrarySession.getLocalizer`.

See Also:
  Serialized Form
(Published)

Field Summary
`static java.lang.String` | `ADDEDEXTENDEDRESOURCEBUNDLENAME` Internal property name for adding an extended resource property bundle names.
`static java.lang.String` | `CHARENCODING` Internal property name for the character encoding.
`static java.lang.String` | `DATEFORMATTER` Internal property name for the date formatter.
`static java.lang.String` | `EXTENDEDRESOURCEBUNDLENAMES` Internal property name for the extended resource property bundle names.
`static java.lang.String` | `LANGUAGE` Internal property name for the context language.
`static java.lang.String` | `LOCALE` Internal property name for the locale.
`protected java.util.Calendar` | `m_Calendar` The Calendar of this Localizer.
`protected java.lang.String` | `m_CharEncoding` The Iana character encoding of this Localizer.
`protected java.text.DateFormat` | `m_DateFormatter` The date formatter of this Localizer.
`protected boolean` | `m_DefaultExtendedResourceBundleNamesAdded` Have the default names of the extended resource bundles been added to this Localizer?
`protected java.util.Vector` | `m_ExtendedResourceBundleNames` The names of the extended resource bundles of this Localizer.
`protected java.util.Vector` | `m_ExtendedResourceBundles` The extended resource bundles of this Localizer.
`protected java.lang.String` | `m_Language` The Oracle language name for context search.
`protected java.util.Locale` | `m_Locale` The locale of this Localizer.
`protected java.text.NumberFormat` | `m_NumberFormatter` The number formatter of this Localizer.
`protected java.util.ResourceBundle` | `m_ResourceBundle` The resource bundle of this Localizer.
`protected LibrarySession` | `m_Session` The LibrarySession to which this Localizer is bound.
`protected java.text.DateFormat` | `m_TimeFormatter` The time formatter of this Localizer.
`protected java.util.TimeZone` | `m_TimeZone` The time zone of this Localizer.
`static java.lang.String` | `NUMBERFORMATTER` Internal property name for the number formatter.
`static java.lang.String` | `REMOVEALLEXTENDEDRESOURCEBUNDLENAMES` Internal property name for removing all extended resource property bundle names.
`static java.lang.String` | `REMOVEDEXTENDEDRESOURCEBUNDLENAME` Internal property name for removing an extended resource property bundle names.
`protected static java.util.Locale` | `s_NoLanguageLocale` A static Locale (no lang or country) for forced english translations.
`protected static Localizer` | `s_UsEnglishLocalizer` A static US English Localizer.
`static java.lang.String` | `TIMEFORMATTER` Internal property name for the time formatter.
`static java.lang.String` | `TIMEZONE` Internal property name for the timezone.

Constructor Summary
`Localizer()` Constructs a Localizer.
`Localizer(java.util.Locale locale)` Constructs a Localizer for the specified locale.
`Localizer(java.util.Locale locale, LibrarySession session)` Constructs a Localizer for the specified locale.

Method Summary
`void` | `addExtendedResourceBundle(java.lang.String bundleName)` Adds a resource bundle to the vector if it is not there already.
`static java.util.Locale` | `constructLocale(java.lang.String localeString)` Construct a Locale from a String representation.
`java.util.Calendar` | `getCalendar()` Gets the Calendar of this Localizer.
`java.lang.String` | `getCharEncoding()` Gets the Iana character set of this Localizer.
`java.text.DateFormat` | `getDateFormatter()` Gets the date formatter of this Localizer.
`static Localizer` | `getDefault()` Gets the default US English Localizer.
`protected java.util.Locale` | `getDefaultLocale()` Gets the default locale, first looks in the properties file, second looks at the JavaVM.
`java.lang.String[]` | `getExtendedResourceBundles()` Gets the extended resource bundles for this Localizer.
`java.lang.String` | `getLanguage()` Returns the language for this LibrarySession in English.
`java.util.Locale` | `getLocale()` Gets the locale of this Localizer.
`java.text.NumberFormat` | `getNumberFormatter()` Gets the number formatter of this Localizer.
`java.lang.String` | `getResourceString(java.lang.String key)` Gets the resource string for the specified key.
`java.lang.String` | `getResourceString(java.lang.String key, java.lang.Object[] params)` Gets the resource string for the specified key, and substitutes the specified parameters into that resource string.
`java.text.DateFormat` | `getTimeFormatter()` Gets the time formatter of this Localizer.
`java.util.TimeZone` | `getTimeZone()` Gets the time zone of this Localizer.
`void` | `removeAllExtendedResourceBundles()` Removes all extended resource bundles.
`void` | `removeExtendedResourceBundle(java.lang.String bundleName)` Removes a resource bundle from the vector.
`static void` | `resetDefaultLocalizerExtendedResourceBundles(LibrarySession session)` Initialize the default Localizer's set of Extended resource bundles
`void` | `setCharEncoding(java.lang.String charEncoding)` Sets the Iana character set of this Localizer.
`void` | `setDateFormatter(java.text.DateFormat dateFormatter)` Sets the date formatter of this Localizer.
`void` | `setDefaultExtendedResourceBundles()` Sets the default set of extended resource bundle names to be used.
`void` | `setExtendedResourceBundles(java.lang.String[] baseNames)` Sets the extended resource bundles for this Localizer.
`void` | `setLanguage(java.lang.String language)` Sets the language to be used by context search.
`void` | `setLocale(java.util.Locale locale)` Sets the locale of this Localizer.
`void` | `setNumberFormatter(java.text.NumberFormat numberFormatter)` Sets the number formatter of this Localizer.
`void` | `setTimeFormatter(java.text.DateFormat timeFormatter)` Sets the time formatter of this Localizer.
`void` | `setTimeZone(java.util.TimeZone timeZone)` Sets the time zone of this Localizer.
`protected void` | `updateTimeZone(java.util.TimeZone timeZone)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LOCALE

    public static final java.lang.String LOCALE

  Description copied from class: `Localizer`
  Internal property name for the locale.

  See Also:
    Constant Field Values
  (Unpublished)

### CHARENCODING

    public static final java.lang.String CHARENCODING

  Description copied from class: `Localizer`
  Internal property name for the character encoding.

  See Also:
    Constant Field Values
  (Unpublished)

### LANGUAGE

    public static final java.lang.String LANGUAGE

  Description copied from class: `Localizer`
  Internal property name for the context language.

  See Also:
    Constant Field Values
  (Unpublished)

### NUMBERFORMATTER

    public static final java.lang.String NUMBERFORMATTER

  Description copied from class: `Localizer`
  Internal property name for the number formatter.

  See Also:
    Constant Field Values
  (Unpublished)

### DATEFORMATTER

    public static final java.lang.String DATEFORMATTER

  Description copied from class: `Localizer`
  Internal property name for the date formatter.

  See Also:
    Constant Field Values
  (Unpublished)

### TIMEFORMATTER

    public static final java.lang.String TIMEFORMATTER

  Description copied from class: `Localizer`
  Internal property name for the time formatter.

  See Also:
    Constant Field Values
  (Unpublished)

### TIMEZONE

    public static final java.lang.String TIMEZONE

  Description copied from class: `Localizer`
  Internal property name for the timezone.

  See Also:
    Constant Field Values
  (Unpublished)

### EXTENDEDRESOURCEBUNDLENAMES

    public static final java.lang.String EXTENDEDRESOURCEBUNDLENAMES

  Description copied from class: `Localizer`
  Internal property name for the extended resource property bundle names.

  See Also:
    Constant Field Values
  (Unpublished)

### ADDEDEXTENDEDRESOURCEBUNDLENAME

    public static final java.lang.String ADDEDEXTENDEDRESOURCEBUNDLENAME

  Description copied from class: `Localizer`
  Internal property name for adding an extended resource property bundle names.

  See Also:
    Constant Field Values
  (Unpublished)

### REMOVEDEXTENDEDRESOURCEBUNDLENAME

    public static final java.lang.String REMOVEDEXTENDEDRESOURCEBUNDLENAME

  Description copied from class: `Localizer`
  Internal property name for removing an extended resource property bundle names.

  See Also:
    Constant Field Values
  (Unpublished)

### REMOVEALLEXTENDEDRESOURCEBUNDLENAMES

    public static final java.lang.String REMOVEALLEXTENDEDRESOURCEBUNDLENAMES

  Description copied from class: `Localizer`
  Internal property name for removing all extended resource property bundle names.

  See Also:
    Constant Field Values
  (Unpublished)

### m_Session

    protected transient LibrarySession m_Session

  Description copied from class: `Localizer`
  The LibrarySession to which this Localizer is bound.

  (Unpublished)

### m_Locale

    protected java.util.Locale m_Locale

  Description copied from class: `Localizer`
  The locale of this Localizer.

  (Unpublished)

### m_CharEncoding

    protected java.lang.String m_CharEncoding

  Description copied from class: `Localizer`
  The Iana character encoding of this Localizer.

  (Unpublished)

### m_Language

    protected java.lang.String m_Language

  Description copied from class: `Localizer`
  The Oracle language name for context search.

  (Unpublished)

### m_NumberFormatter

    protected java.text.NumberFormat m_NumberFormatter

  Description copied from class: `Localizer`
  The number formatter of this Localizer.

  (Unpublished)

### m_DateFormatter

    protected java.text.DateFormat m_DateFormatter

  Description copied from class: `Localizer`
  The date formatter of this Localizer.

  (Unpublished)

### m_TimeFormatter

    protected java.text.DateFormat m_TimeFormatter

  Description copied from class: `Localizer`
  The time formatter of this Localizer.

  (Unpublished)

### m_Calendar

    protected java.util.Calendar m_Calendar

  Description copied from class: `Localizer`
  The Calendar of this Localizer.

  (Unpublished)

### m_TimeZone

    protected java.util.TimeZone m_TimeZone

  Description copied from class: `Localizer`
  The time zone of this Localizer.

  (Unpublished)

### m_ResourceBundle

    protected transient java.util.ResourceBundle m_ResourceBundle

  Description copied from class: `Localizer`
  The resource bundle of this Localizer.

  (Unpublished)

### m_ExtendedResourceBundles

    protected transient java.util.Vector m_ExtendedResourceBundles

  Description copied from class: `Localizer`
  The extended resource bundles of this Localizer.

  (Unpublished)

### m_ExtendedResourceBundleNames

    protected transient java.util.Vector m_ExtendedResourceBundleNames

  Description copied from class: `Localizer`
  The names of the extended resource bundles of this Localizer.

  (Unpublished)

### m_DefaultExtendedResourceBundleNamesAdded

    protected boolean m_DefaultExtendedResourceBundleNamesAdded

  Description copied from class: `Localizer`
  Have the default names of the extended resource bundles been added to this Localizer?

  (Unpublished)

### s_UsEnglishLocalizer

    protected static Localizer s_UsEnglishLocalizer

  Description copied from class: `Localizer`
  A static US English Localizer.

  (Unpublished)

### s_NoLanguageLocale

    protected static java.util.Locale s_NoLanguageLocale

  Description copied from class: `Localizer`
  A static Locale (no lang or country) for forced english translations.

  (Unpublished)

Constructor Detail

### Localizer

    public Localizer()
              throws IfsException

  Constructs a Localizer.

  The Localizer's locale is the default locale of the Java VM. The Localizer has default number, date, and time formatters for that locale, and uses 8859_1 (ISO Latin1) character encoding.

  Throws:
    `IfsException` - (IFS-12000) if the operation fails
  (Published)

### Localizer

    public Localizer(java.util.Locale locale)
              throws IfsException

  Constructs a Localizer for the specified locale.

  The Localizer has default number, date, time formatters; and default Timezone and character encoding settings.

  Parameters:
    `locale` - the locale of the Localizer. If null, the default locale of the Java VM is used.
  Throws:
    `IfsException` - (IFS-12000) if the operation fails
  (Published)

### Localizer

    public Localizer(java.util.Locale locale,
                     LibrarySession session)
              throws IfsException

  Constructs a Localizer for the specified locale.

  The Localizer has default number, date, time formatters; and default Timezone and character encoding settings.

  Parameters:
    `locale` - the locale of the Localizer. If null, the default locale of the Java VM is used.
    `session` - the LibrarySession to which the Localizer is bound; any changes to this Localizer will trigger identical changes in the Localizer of the corresponding S_LibrarySession
  Throws:
    `IfsException` - (IFS-12000) if the operation fails
  (Published)

Method Detail

### setDefaultExtendedResourceBundles

    public void setDefaultExtendedResourceBundles()
                                           throws IfsException

  Description copied from class: `Localizer`
  Sets the default set of extended resource bundle names to be used.

  Throws:
    `IfsException` - if the operation fails
  (Unpublished)

### resetDefaultLocalizerExtendedResourceBundles

    public static void resetDefaultLocalizerExtendedResourceBundles(LibrarySession session)
                                                             throws IfsException

  Description copied from class: `Localizer`
  Initialize the default Localizer's set of Extended resource bundles

  Parameters:
    `session` - the session context
  Throws:
    `IfsException` - if the operation fails
  (Unpublished)

### getLocale

    public java.util.Locale getLocale()
                               throws IfsException

  Description copied from class: `Localizer`
  Gets the locale of this Localizer.

  Returns:
    the locale
  Throws:
    `IfsException` - if the operation fails
  (Published)

### constructLocale

    public static java.util.Locale constructLocale(java.lang.String localeString)

  Description copied from class: `Localizer`
  Construct a Locale from a String representation.

  The string should be one of:

  - lang
  - lang_COUNTRY
  - lang_COUNTRY_variant
  - lang__variant
  Where lang is the 2-letter lowercase language code, COUNTRY is the 2-letter uppercase country code, and variant is the locale variant.

  Parameters:
    `localeString` - the string representation of the Locale
  Returns:
    the locale
  (Unpublished)

### setLocale

    public void setLocale(java.util.Locale locale)
                   throws IfsException

  Description copied from class: `Localizer`
  Sets the locale of this Localizer.

  The number formatter, date formatter, and time formatter are set to default formatters for the specified locale.

  Parameters:
    `locale` - the locale
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getDefault

    public static Localizer getDefault()

  Description copied from class: `Localizer`
  Gets the default US English Localizer.

  This default is used by `IfsException.getMessage`.

  Returns:
    the default Localizer
  (Published)

### setCharEncoding

    public void setCharEncoding(java.lang.String charEncoding)
                         throws IfsException

  Description copied from class: `Localizer`
  Sets the Iana character set of this Localizer.

  Parameters:
    `charEncoding` - the Iana character set.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getCharEncoding

    public java.lang.String getCharEncoding()
                                     throws IfsException

  Description copied from class: `Localizer`
  Gets the Iana character set of this Localizer.

  Returns:
    the character encoding
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getDefaultLocale

    protected java.util.Locale getDefaultLocale()
                                         throws IfsException

  Description copied from class: `Localizer`
  Gets the default locale, first looks in the properties file, second looks at the JavaVM.

  Returns:
    the Locale
  Throws:
    `IfsException` - if the operation fails
  (Unpublished)

### setLanguage

    public void setLanguage(java.lang.String language)
                     throws IfsException

  Description copied from class: `Localizer`
  Sets the language to be used by context search. If none set, the default is the value of DefaultLanguage from the properties file. The serverside code will determine the default to use.

  Parameters:
    `language` - the Oracle language name.
  Throws:
    `IfsException`
  (Published)

### getLanguage

    public java.lang.String getLanguage()
                                 throws IfsException

  Description copied from class: `Localizer`
  Returns the language for this LibrarySession in English.

  Returns:
    the Oracle IMT language name. Defaults to property, DefaultLanguage, in properties file.
  Throws:
    `IfsException`
  (Published)

### setNumberFormatter

    public void setNumberFormatter(java.text.NumberFormat numberFormatter)
                            throws IfsException

  Description copied from class: `Localizer`
  Sets the number formatter of this Localizer.

  Parameters:
    `numberFormatter` - the number formatter. If null, a default number formatter for the locale of this Localizer is used.
  Throws:
    `IfsException` - (IFS-12002) if the operation fails
  (Published)

### getNumberFormatter

    public java.text.NumberFormat getNumberFormatter()
                                              throws IfsException

  Description copied from class: `Localizer`
  Gets the number formatter of this Localizer.

  Returns:
    the number formatter
  Throws:
    `IfsException` - if the operation fails
  (Published)

### setDateFormatter

    public void setDateFormatter(java.text.DateFormat dateFormatter)
                          throws IfsException

  Description copied from class: `Localizer`
  Sets the date formatter of this Localizer.

  Parameters:
    `dateFormatter` - the date formatter. If null, a default date formatter for the locale of this Localizer is used.
  Throws:
    `IfsException` - (IFS-12003) if the operation fails
  (Published)

### getDateFormatter

    public java.text.DateFormat getDateFormatter()
                                          throws IfsException

  Description copied from class: `Localizer`
  Gets the date formatter of this Localizer.

  Returns:
    the date formatter
  Throws:
    `IfsException` - if the operation fails
  (Published)

### setTimeFormatter

    public void setTimeFormatter(java.text.DateFormat timeFormatter)
                          throws IfsException

  Description copied from class: `Localizer`
  Sets the time formatter of this Localizer.

  Parameters:
    `timeFormatter` - the time formatter. If null, a default time formatter for the locale of this Localizer is used.
  Throws:
    `IfsException` - (IFS-12004) if the operation fails
  (Published)

### getTimeFormatter

    public java.text.DateFormat getTimeFormatter()
                                          throws IfsException

  Description copied from class: `Localizer`
  Gets the time formatter of this Localizer.

  Returns:
    the time formatter
  Throws:
    `IfsException` - if the operation fails
  (Published)

### setTimeZone

    public void setTimeZone(java.util.TimeZone timeZone)
                     throws IfsException

  Description copied from class: `Localizer`
  Sets the time zone of this Localizer.

  Parameters:
    `timeZone` - the time zone. If null, a default time zone for the locale of this Localizer is used.
  Throws:
    `IfsException` - (IFS-12005) if the operation fails
  (Published)

### updateTimeZone

    protected void updateTimeZone(java.util.TimeZone timeZone)

  (Unpublished)

### getTimeZone

    public java.util.TimeZone getTimeZone()
                                   throws IfsException

  Description copied from class: `Localizer`
  Gets the time zone of this Localizer.

  Returns:
    the time zone
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getCalendar

    public java.util.Calendar getCalendar()
                                   throws IfsException

  Description copied from class: `Localizer`
  Gets the Calendar of this Localizer.

  Returns:
    the Calendar
  Throws:
    `IfsException` - if the operation fails
  (Published)

### setExtendedResourceBundles

    public void setExtendedResourceBundles(java.lang.String[] baseNames)
                                    throws IfsException

  Description copied from class: `Localizer`
  Sets the extended resource bundles for this Localizer.

  Parameters:
    `baseNames` - an array of resource bundle names. Each resource bundle name must be a valid argument to `ResourceBundle.getBundle(String)`.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getExtendedResourceBundles

    public java.lang.String[] getExtendedResourceBundles()
                                                  throws IfsException

  Description copied from class: `Localizer`
  Gets the extended resource bundles for this Localizer.

  When a Localizer is constructed, its extended resource bundles default to those of the default Localizer (`Localizer.getDefault()`).

  Returns:
    an array of resource bundle names. Each resource bundle name is a valid argument to `ResourceBundle.getBundle(String)`.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### addExtendedResourceBundle

    public void addExtendedResourceBundle(java.lang.String bundleName)
                                   throws IfsException

  Description copied from class: `Localizer`
  Adds a resource bundle to the vector if it is not there already.

  Parameters:
    `bundleName` - the name of the resource bundle.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### removeExtendedResourceBundle

    public void removeExtendedResourceBundle(java.lang.String bundleName)
                                      throws IfsException

  Description copied from class: `Localizer`
  Removes a resource bundle from the vector.

  Parameters:
    `bundleName` - the name of the resource bundle.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### removeAllExtendedResourceBundles

    public void removeAllExtendedResourceBundles()
                                          throws IfsException

  Description copied from class: `Localizer`
  Removes all extended resource bundles.

  Throws:
    `IfsException` - if the operation fails
  (Published)

### getResourceString

    public java.lang.String getResourceString(java.lang.String key)
                                       throws IfsException

  Description copied from class: `Localizer`
  Gets the resource string for the specified key.

  The method looks-up the key in each extended resource bundle, in the order specified by the array in `setExtendedResourceBundles`, until it finds a bundle containing the key. If no extended resource bundle contains the key, the default resource bundle (LibraryResources) is used.

  Parameters:
    `key` - the resource bundle key
  Returns:
    the resource string
  Throws:
    `IfsException` - IFS-12001 if the operation fails
  (Published)

### getResourceString

    public java.lang.String getResourceString(java.lang.String key,
                                              java.lang.Object[] params)
                                       throws IfsException

  Description copied from class: `Localizer`
  Gets the resource string for the specified key, and substitutes the specified parameters into that resource string.

  The method looks-up the key using `getResourceString(key)`. Next, `java.text.MessageFormat` is used to substitute the parameters specified by `params` into the key's value. If a string element of `params` is delimited by brackets, i.e. "`{param}`", then that element is replaced with the value returned by `getResourceString("param")` before being passed to `MessageFormat`.

  Parameters:
    `key` - the resource bundle key
    `params` - an array of Objects to be substituted into the resource bundle message using using `java.text.MessageFormat`
  Returns:
    the formatted resource string
  Throws:
    `IfsException` - IFS-12006 if the operation fails
  (Published)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD