public class ResourceBundleFactory
extends java.lang.Object
ResourceBundleWrapper
objects which are wrappers around regular ResourceBundle
:s that provide us with
some extra functionality.
NOTE! Plug-ins and extensions that are not part of the BASE core are usually loaded with a
different class loader than the rest of BASE. If they are including resource in their own
JAR files, they must use the versions that take a class loader as the last parameter and
set it to the class loader of of their own classes. Eg.
this.getClass().getClassLoader()
.
Modifier | Constructor and Description |
---|---|
private |
ResourceBundleFactory() |
Modifier and Type | Method and Description |
---|---|
static ResourceBundleWrapper |
getResourceBundle(java.lang.String name,
java.util.Locale locale)
Same as
getResouceBundle(name, locale, null) . |
static ResourceBundleWrapper |
getResourceBundle(java.lang.String name,
java.util.Locale locale,
java.lang.ClassLoader loader)
Get a resource bundle for the given locale.
|
static ResourceBundleWrapper |
getResourceBundle(java.lang.String name,
SessionControl sc)
Same as
getResouceBundle(name, sc, null) . |
static ResourceBundleWrapper |
getResourceBundle(java.lang.String name,
SessionControl sc,
java.lang.ClassLoader loader)
Get a resource bundle for the given session control.
|
public static ResourceBundleWrapper getResourceBundle(java.lang.String name, SessionControl sc)
getResouceBundle(name, sc, null)
.public static ResourceBundleWrapper getResourceBundle(java.lang.String name, SessionControl sc, java.lang.ClassLoader loader)
SessionControl.getLocale()
is used as the locale,
otherwise the server default locale (Config.getLocale()
) is used.name
- The name of the resource bundlesc
- A session control, or nullloader
- The class loader to use when locating the resource bundle(s).
If null, the context class loader of the current thread is usedThread.getContextClassLoader()
public static ResourceBundleWrapper getResourceBundle(java.lang.String name, java.util.Locale locale)
getResouceBundle(name, locale, null)
.public static ResourceBundleWrapper getResourceBundle(java.lang.String name, java.util.Locale locale, java.lang.ClassLoader loader)
name
- The name of the resource bundlelocale
- A locale objectloader
- The class loader to use when locating the resource bundle(s).
If null, the context class loader of the current thread is usedThread.getContextClassLoader()