|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.webapp.nls.NlsContext
public final class NlsContext
Static accessor class to the current locale, "jargon" and currency information. This class behaves as a static class but has threadlocal based storage behind it; this allows the locale information to be different for every request. The actual locale to use for a request can be set by a server on a per-request basis. If no per-request locale is set this uses the default locale.
In addition, this also contains the current "currency locale" which is set once per application, when used. By default most applications will contain monetary amounts in a single currency only, regardless of the language they are being used in. For instance a dutch system can present information in English for a british user, but will still present amounts in euro's, not pounds.
Method Summary | |
---|---|
static NlsCodeTable |
createCodeTable(java.lang.String name)
Create a coded translation table for code tables. |
static BundleRef |
getBundleRef(java.lang.String bundlekey)
Get the BundleRef for the specified bundle key. |
static java.lang.String |
getCodeDescription(java.lang.String tablename,
java.lang.String code,
java.lang.String defmsg)
FIXME This needs to use a cached code translation table from the database. |
static java.util.Currency |
getCurrency()
Returns a Currency object for the current currency locale. |
static java.util.Locale |
getCurrencyLocale()
The locale for the currency being handled in the application. |
static java.lang.String |
getCurrencySymbol()
Returns the currency symbol (not the currency code, damnit) for the current currency locale. |
static java.text.DateFormat |
getDateFormat(int style)
|
static java.text.DateFormat |
getDateTimeFormat(int s1,
int s2)
|
static java.util.Locale |
getDefault()
Returns the default ViewPoint locale. |
static java.util.Locale |
getDefaultCurrencyLocale()
|
static java.lang.String |
getDialect()
|
static java.util.Locale |
getLocale()
Gets the current locale in use by the request we're executing at this time - this is the PROPER call to use from normal user code. |
static void |
setCurrencyLocale(java.util.Locale loc)
Sets the currency locale to use for this request. |
static void |
setDefaultCurrencyLocale(java.util.Locale defaultCurrencyLocale)
|
static void |
setDialect(java.lang.String dialect)
|
static void |
setLocale(java.util.Locale loc)
Sets the current locale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.Locale getDefault()
public static void setDefaultCurrencyLocale(java.util.Locale defaultCurrencyLocale)
public static java.util.Locale getDefaultCurrencyLocale()
public static java.util.Locale getCurrencyLocale()
The locale for the currency being handled in the application. Can be changed per request, and defaults to the "default locale" (NOT the per request locale!). This is used for applications that use only a single currency throughout the application; if an application uses multiple currencies the application itself must provide services to handle the "current" currency and monetary conversions of currencies.
This will return the default locale if not explicitly set.
public static void setCurrencyLocale(java.util.Locale loc)
loc
- public static java.util.Currency getCurrency()
public static java.lang.String getCurrencySymbol()
public static java.lang.String getDialect()
public static void setDialect(java.lang.String dialect)
public static java.util.Locale getLocale()
public static void setLocale(java.util.Locale loc)
loc
- public static BundleRef getBundleRef(java.lang.String bundlekey)
bundlekey
- The key (package/filename) of the resource bundle without .properties!
public static java.text.DateFormat getDateFormat(int style)
public static java.text.DateFormat getDateTimeFormat(int s1, int s2)
public static NlsCodeTable createCodeTable(java.lang.String name)
public static java.lang.String getCodeDescription(java.lang.String tablename, java.lang.String code, java.lang.String defmsg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |