|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidad.context.LocaleContext
org.apache.myfaces.trinidadinternal.share.nls.LocaleContextImpl
public class 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.
Clients should never subclass this class.
Constructor Summary | |
---|---|
LocaleContextImpl(java.util.Locale locale)
Creates a LocaleContext based off of the specified Locale. |
|
LocaleContextImpl(java.util.Locale formattingLocale,
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. |
char |
getDecimalSeparator()
Returns the character used as a decimal separator. |
java.lang.String |
getFormattingIANALocaleString()
Returns the Locale in IANA String format. |
java.util.Locale |
getFormattingLocale()
Returns the locale that should be used for formatting. |
char |
getGroupingSeparator()
Returns the character used to separate number groups. |
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 |
getTwoDigitYearStart()
Returns the year offset for parsing years with only two digits. |
int |
hashCode()
Override of Object.hashCode(). |
boolean |
isRightToLeft()
|
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 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 |
---|
public LocaleContextImpl(java.util.Locale locale)
public LocaleContextImpl(java.util.Locale formattingLocale, java.util.Locale translationLocale)
formattingLocale
- Locale providing default formatting
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.Method Detail |
---|
public java.util.Locale getTranslationLocale()
getTranslationLocale
in class org.apache.myfaces.trinidad.context.LocaleContext
public java.util.Locale getFormattingLocale()
getFormattingLocale
in class org.apache.myfaces.trinidad.context.LocaleContext
public java.lang.String getFormattingIANALocaleString()
getFormattingIANALocaleString
in class org.apache.myfaces.trinidad.context.LocaleContext
public java.lang.String getTranslationIANALocaleString()
getTranslationIANALocaleString
in class org.apache.myfaces.trinidad.context.LocaleContext
public boolean isRightToLeft()
isRightToLeft
in class org.apache.myfaces.trinidad.context.LocaleContext
public int getReadingDirection()
org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils
.
This method will never return
LocaleUtils.DIRECTION_DEFAULT
.
setReadingDirection(int)
,
LocaleUtils
@Deprecated public void setReadingDirection(int newReadingDirection)
org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils
.
MutableLocaleContext
public java.util.TimeZone getTimeZone()
getTimeZone
in class org.apache.myfaces.trinidad.context.LocaleContext
@Deprecated public void setTimeZone(java.util.TimeZone newTimeZone)
MutableLocaleContext
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.ResourceBundle getBundle(java.lang.String baseBundleName) throws java.util.MissingResourceException
As the LocaleContext maintains a cache of found ResourceBundles,
this is much faster than using
ResourceBundle.getBundle
getBundle
in class org.apache.myfaces.trinidad.context.LocaleContext
java.util.MissingResourceException
ResourceBundle.getBundle(java.lang.String)
public int getTwoDigitYearStart()
getTwoDigitYearStart
in class org.apache.myfaces.trinidad.context.LocaleContext
public char getGroupingSeparator()
getGroupingSeparator
in class org.apache.myfaces.trinidad.context.LocaleContext
public char getDecimalSeparator()
getDecimalSeparator
in class org.apache.myfaces.trinidad.context.LocaleContext
public final DateFormatContext getDateFormatContext()
getDateFormatContextImpl
returns null;
public final DecimalFormatContext getDecimalFormatContext()
getDecimalFormatContextImpl
returns null;
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected DateFormatContext getDateFormatContextImpl()
getDateFormatContext
will
use the default value instead.
protected DecimalFormatContext getDecimalFormatContextImpl()
getDecimalFormatContext
will
use the default value instead.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |