org.apache.myfaces.trinidadinternal.share.nls
Class MutableLocaleContext

java.lang.Object
  extended by org.apache.myfaces.trinidad.context.LocaleContext
      extended by org.apache.myfaces.trinidadinternal.share.nls.LocaleContextImpl
          extended by org.apache.myfaces.trinidadinternal.share.nls.MutableLocaleContext

public final class MutableLocaleContext
extends LocaleContextImpl

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.

Setting the DateFormatContext clones the parameter and wraps it in an ImmutableDateFormatContext if necessary. This will then be returned by getDateFormatContext. Clients are therefore guaranteed that this property can not be modified after it is set on the LocaleContext, without a subsequent call to setDateFormatContext.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/nls/MutableLocaleContext.java#0 $) $Date: 10-nov-2005.19:00:05 $
Author:
The Oracle ADF Faces Team

Constructor Summary
MutableLocaleContext(java.util.Locale formattingLocale)
          Creates a MutableLocaleContext based off of the specified Locale.
MutableLocaleContext(org.apache.myfaces.trinidad.context.LocaleContext context)
          Creates a MutableLocaleContext based on a pre-existing LocaleContext.
MutableLocaleContext(java.util.Locale formattingLocale, java.util.Locale translationLocale)
          Creates a MutableLocaleContext based off of the specified Locale and using a different Locale for translations.
 
Method Summary
protected  DateFormatContext getDateFormatContextImpl()
          Returns the DateFormatContext containing all date format parameters.
protected  DecimalFormatContext getDecimalFormatContextImpl()
          Returns the DecimalFormatContext containing all number format parameters.
 void setDateFormatContext(DateFormatContext dateFormatContext)
          Sets the DateFormatContext containing all date format parameters.
protected  void setDateFormatContextImpl(DateFormatContext dateFormatContext)
          Sets the DateFormatContext containing all date format parameters.
 void setDecimalFormatContext(DecimalFormatContext decimalFormatContext)
          Sets the DecimalFormatContext containing all number format parameters.
protected  void setDecimalFormatContextImpl(DecimalFormatContext decimalFormatContext)
          Sets the DecimalFormatContext containing all number format parameters.
 void setReadingDirection(int newReadingDirection)
          Sets the new reading direction to be one of the reading directions defined in org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils.
 void setTimeZone(java.util.TimeZone newTimeZone)
          Sets the TimeZone that the user is running in.
 
Methods inherited from class org.apache.myfaces.trinidadinternal.share.nls.LocaleContextImpl
equals, getBundle, getDateFormatContext, getDecimalFormatContext, getDecimalSeparator, getFormattingIANALocaleString, getFormattingLocale, getGroupingSeparator, getReadingDirection, getTimeZone, getTranslationIANALocaleString, getTranslationLocale, getTwoDigitYearStart, hashCode, isRightToLeft, toString
 
Methods inherited from class org.apache.myfaces.trinidad.context.LocaleContext
getIANALocaleString, getLocale
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableLocaleContext

public MutableLocaleContext(java.util.Locale formattingLocale)
Creates a MutableLocaleContext based off of the specified Locale.


MutableLocaleContext

public MutableLocaleContext(java.util.Locale formattingLocale,
                            java.util.Locale translationLocale)
Creates a MutableLocaleContext 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:
formattingLocale - 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 formattingLocale is used.

MutableLocaleContext

public MutableLocaleContext(org.apache.myfaces.trinidad.context.LocaleContext context)
Creates a MutableLocaleContext based on a pre-existing LocaleContext.

Method Detail

setReadingDirection

public void setReadingDirection(int newReadingDirection)
Sets the new reading direction to be one of the reading directions defined in org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils.

If set to any value other than LocaleUtils.DIRECTION_DEFAULT, the new value will override the default determination of the reading direction based on the Locale.

Overrides:
setReadingDirection in class LocaleContextImpl
See Also:
LocaleContextImpl.getReadingDirection(), LocaleUtils

setTimeZone

public void setTimeZone(java.util.TimeZone newTimeZone)
Sets the TimeZone that the user is running in. Setting this value to null will set the TimeZone to the default TimeZone.

Overrides:
setTimeZone in class LocaleContextImpl
See Also:
MutableLocaleContext

setDateFormatContext

public final void setDateFormatContext(DateFormatContext dateFormatContext)
Sets the DateFormatContext containing all date format parameters. If necessary, this dateFormatContext is cloned and wrapped inside an ImmutableDateFormatContext which is returned by getDateFormatContext.


setDecimalFormatContext

public final void setDecimalFormatContext(DecimalFormatContext decimalFormatContext)
Sets the DecimalFormatContext containing all number format parameters. If necessary, this decimalFormatContext is cloned and wrapped inside an ImmutableDecimalFormatContext which is returned by getDecimalFormatContext.


getDateFormatContextImpl

protected DateFormatContext getDateFormatContextImpl()
Returns the DateFormatContext containing all date format parameters.

Overrides:
getDateFormatContextImpl in class LocaleContextImpl

setDateFormatContextImpl

protected void setDateFormatContextImpl(DateFormatContext dateFormatContext)
Sets the DateFormatContext containing all date format parameters.


getDecimalFormatContextImpl

protected DecimalFormatContext getDecimalFormatContextImpl()
Returns the DecimalFormatContext containing all number format parameters.

Overrides:
getDecimalFormatContextImpl in class LocaleContextImpl

setDecimalFormatContextImpl

protected void setDecimalFormatContextImpl(DecimalFormatContext decimalFormatContext)
Sets the DecimalFormatContext containing all number format parameters.



Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.