public final class MessageBundles extends Object
In order to register your bundle, you simply need to have an
implementation of MessageBundleLoader. The first time you call this
factory's getBundle(Class) with the class of this implementation,
it will create a cached instance of this provider and return the bundle.
Say your MessageBundleLoader implementation is called MyMessageBundle and is in package com.example.util, then, in your
code, this is as simple as:
import com.example.util.MyMessageBundle;
// In your class:
private static final MessageBundle BUNDLE
= MessageBundles.getBundle(MyMessageBundle.class);
This will automatically load the bundle for you.
| Modifier and Type | Method and Description |
|---|---|
static MessageBundle |
getBundle(Class<? extends MessageBundleLoader> c)
Get a message bundle for a registered
MessageBundleLoader
implementation |
public static MessageBundle getBundle(Class<? extends MessageBundleLoader> c)
MessageBundleLoader
implementationc - the class of the implementation