Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.share.nls
Class LocaleContext

java.lang.Object
  |
  +--oracle.cabo.share.nls.LocaleContext
Direct Known Subclasses:
MutableLocaleContext

public class LocaleContext
extends java.lang.Object

Context for locale-specific operations and properties. All of the properties should initially default to those of the base Locale, while allowing the locale-specific properties to be overridden.

It is expected that additional properties will be added to this class over time in order to support overriding the date and number formats.

Clients should never subclass this class.


Constructor Summary
LocaleContext()
          Creates a LocaleContext based off of the default Locale.
LocaleContext(java.util.Locale baseLocale)
          Creates a LocaleContext based off of the specified Locale.
LocaleContext(java.util.Locale baseLocale, java.util.Locale translationLocale)
          Creates a LocaleContext based off of the specified Locale and using a different Locale for translations.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Override of Object.equals().
 java.util.ResourceBundle getBundle(java.lang.String baseBundleName)
          Returns the resource bundle with the specified name, for this translation locale.
 DateFormatContext getDateFormatContext()
          Returns the DateFormatContext containing all date format parameters, falling back on defaults when getDateFormatContextImpl returns null;
protected  DateFormatContext getDateFormatContextImpl()
          Returns the DateFormatContext containing all date format parameters.
 DecimalFormatContext getDecimalFormatContext()
          Returns the DecimalFormatContext containing all number format parameters, falling back on defaults when getDecimalFormatContextImpl returns null;
protected  DecimalFormatContext getDecimalFormatContextImpl()
          Returns the DecimalFormatContext containing all number format parameters.
 java.lang.String getIANALocaleString()
          Returns the Locale in IANA String format.
 java.util.Locale getLocale()
          Returns the locale that should be used for rendering.
 int getReadingDirection()
          Returns the reading direction that should be used for rendering.
 java.util.TimeZone getTimeZone()
          Returns the TimeZone that the user is running in.
 java.lang.String getTranslationIANALocaleString()
          Returns the translation Locale in IANA String format.
 java.util.Locale getTranslationLocale()
          Returns the locale that should be used for translations..
 int hashCode()
          Override of Object.hashCode().
 void setReadingDirection(int newReadingDirection)
          Deprecated. use MutableLocaleContext.setReadingDirection() instead
 void setTimeZone(java.util.TimeZone newTimeZone)
          Deprecated. use MutableLocaleContext.setTimeZone() instead
 java.lang.String toString()
          Override of Object.toString().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocaleContext

public LocaleContext()
Creates a LocaleContext based off of the default Locale.

LocaleContext

public LocaleContext(java.util.Locale baseLocale)
Creates a LocaleContext based off of the specified Locale.

LocaleContext

public LocaleContext(java.util.Locale baseLocale,
                     java.util.Locale translationLocale)
Creates a LocaleContext based off of the specified Locale and using a different Locale for translations. Applications that only provide translations for a subset of the Locales provided by subcomponents can use the translation Locale to force subcomponents to only use translations in a language supported by the application.

Parameters:
baseLocale - Locale providing default behavior for the LocaleContext. If not specified, the defualt Locale is used.
translationLocale - Locale to use for translations. If not specified, the baseLocale is used.
Method Detail

getLocale

public java.util.Locale getLocale()
Returns the locale that should be used for rendering. Attributes on the current node should override this.

getTranslationLocale

public java.util.Locale getTranslationLocale()
Returns the locale that should be used for translations..

getIANALocaleString

public java.lang.String getIANALocaleString()
Returns the Locale in IANA String format.

getTranslationIANALocaleString

public java.lang.String getTranslationIANALocaleString()
Returns the translation Locale in IANA String format.

getReadingDirection

public int getReadingDirection()
Returns the reading direction that should be used for rendering.
Returns:
a reading direction from oracle.bali.share.nls.LocaleUtils. This method will never return LocaleUtils.DIRECTION_DEFAULT.

See Also:
setReadingDirection(int), LocaleUtils

setReadingDirection

public void setReadingDirection(int newReadingDirection)
Deprecated. use MutableLocaleContext.setReadingDirection() instead

Sets the new reading direction to be one of the reading directions defined in oracle.bali.share.nls.LocaleUtils.
See Also:
MutableLocaleContext

getTimeZone

public java.util.TimeZone getTimeZone()
Returns the TimeZone that the user is running in.

setTimeZone

public void setTimeZone(java.util.TimeZone newTimeZone)
Deprecated. use MutableLocaleContext.setTimeZone() instead

Sets the TimeZone that the user is running in. Setting this value to null will set the TimeZone to the default TimeZone.
See Also:
MutableLocaleContext

toString

public java.lang.String toString()
Override of Object.toString().
Overrides:
toString in class java.lang.Object

getBundle

public java.util.ResourceBundle getBundle(java.lang.String baseBundleName)
                                   throws java.util.MissingResourceException
Returns the resource bundle with the specified name, for this translation locale.

As the LocaleContext maintains a cache of found ResourceBundles, this is much faster than using ResourceBundle.getBundle

See Also:
ResourceBundle.getBundle(java.lang.String)

getDateFormatContext

public final DateFormatContext getDateFormatContext()
Returns the DateFormatContext containing all date format parameters, falling back on defaults when getDateFormatContextImpl returns null;

getDecimalFormatContext

public final DecimalFormatContext getDecimalFormatContext()
Returns the DecimalFormatContext containing all number format parameters, falling back on defaults when getDecimalFormatContextImpl returns null;

hashCode

public int hashCode()
Override of Object.hashCode().
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Override of Object.equals().
Overrides:
equals in class java.lang.Object

getDateFormatContextImpl

protected DateFormatContext getDateFormatContextImpl()
Returns the DateFormatContext containing all date format parameters. If this method returns null, getDateFormatContext will use the default value instead.

getDecimalFormatContextImpl

protected DecimalFormatContext getDecimalFormatContextImpl()
Returns the DecimalFormatContext containing all number format parameters. If this method returns null, getDecimalFormatContext will use the default value instead.

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.