The setLocale(Locale) method is used to configure locale for the
calling thread. The locale setting is thread inheritable. This means that a
child thread will have the same locale setting as its creator thread until it
changes it explicitly.
Example of usage:
NLS.setLocale(Locale.GERMAN); TransportText t = NLS.getBundleFor(TransportText.class);
| Modifier and Type | Field and Description |
|---|---|
| private static final InheritableThreadLocal | |
| private final Locale | |
| private final Map | |
| public static final Locale | ROOT_LOCALE
The root locale constant. |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| private <T extends TranslationBundle> T | |
| public static < type of the translation bundle T extends TranslationBundle> T | Returns: an instance of the required bundle typerequired bundle type type)Returns an instance of the translation bundle of the required type. |
| public static void | |
| private static NLS | |
| public static void |
| local | back to summary |
|---|---|
| private static final InheritableThreadLocal<NLS> local | |
| locale | back to summary |
|---|---|
| private final Locale locale | |
| map | back to summary |
|---|---|
| private final Map<Class<T>, TranslationBundle> map | |
| ROOT_LOCALE | back to summary |
|---|---|
| public static final Locale ROOT_LOCALE The root locale constant. It is defined here because the Locale.ROOT is not defined in Java 5 | |
| NLS | back to summary |
|---|---|
| private NLS(Locale locale) | |
| clear | back to summary |
|---|---|
| public static void clear() Release resources held by NLS
| |
| get | back to summary |
|---|---|
private <T extends TranslationBundle> T get(Class<T> type)
| |
| getBundleFor | back to summary |
|---|---|
| public static <T extends TranslationBundle> T getBundleFor(Class<T> type) Returns an instance of the translation bundle of the required type. All
public String fields of the bundle instance will get their values
injected as described in the
| |
| setLocale | back to summary |
|---|---|
| public static void setLocale(Locale locale) Sets the locale for the calling thread.
The
| |
| useJVMDefaultInternal | back to summary |
|---|---|
| private static NLS useJVMDefaultInternal() | |
| useJVMDefaultLocale | back to summary |
|---|---|
| public static void useJVMDefaultLocale() Sets the JVM default locale as the locale for the calling thread.
Semantically this is equivalent to
| |