com.github.fge.msgsimple.load
Class MessageBundles

java.lang.Object
  extended by com.github.fge.msgsimple.load.MessageBundles

public final class MessageBundles
extends Object

Centralized access point for bundles

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.


Method Summary
static MessageBundle getBundle(Class<? extends MessageBundleLoader> c)
          Get a message bundle for a registered MessageBundleLoader implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBundle

public static MessageBundle getBundle(Class<? extends MessageBundleLoader> c)
Get a message bundle for a registered MessageBundleLoader implementation

Parameters:
c - the class of the implementation
Returns:
the matching bundle