|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.resources.ResourceBundleFactory
public class ResourceBundleFactory
Factory for loading resource bundles. The factory return 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()
.
Constructor Summary | |
---|---|
private |
ResourceBundleFactory()
|
Method Summary | |
---|---|
static ResourceBundleWrapper |
getResourceBundle(String name,
Locale locale)
Same as getResouceBundle(name, locale, null) . |
static ResourceBundleWrapper |
getResourceBundle(String name,
Locale locale,
ClassLoader loader)
Get a resource bundle for the given locale. |
static ResourceBundleWrapper |
getResourceBundle(String name,
SessionControl sc)
Same as getResouceBundle(name, sc, null) . |
static ResourceBundleWrapper |
getResourceBundle(String name,
SessionControl sc,
ClassLoader loader)
Get a resource bundle for the given session control. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private ResourceBundleFactory()
Method Detail |
---|
public static ResourceBundleWrapper getResourceBundle(String name, SessionControl sc)
getResouceBundle(name, sc, null)
.
getResourceBundle(String, SessionControl, ClassLoader)
public static ResourceBundleWrapper getResourceBundle(String name, SessionControl sc, 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 used
Thread.getContextClassLoader()
public static ResourceBundleWrapper getResourceBundle(String name, Locale locale)
getResouceBundle(name, locale, null)
.
getResourceBundle(String, Locale, ClassLoader)
public static ResourceBundleWrapper getResourceBundle(String name, Locale locale, 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 used
Thread.getContextClassLoader()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |