org.workingfrog.i18n.util
Class Loader

java.lang.Object
  extended byorg.workingfrog.i18n.util.Loader

public class Loader
extends java.lang.Object

Locate i18n resources in the file system.

Author:
Jean-Hugues de Raigniac

Constructor Summary
Loader()
          Empty constructor.
 
Method Summary
 java.util.ResourceBundle getBundle(java.lang.String binding)
          Return a ResourceBundle.
 java.util.HashMap getBundles()
          Return all ResourceBundles for current Locale.
 java.util.HashMap getBundles(java.util.Locale locale)
          Return all ResourceBundles for a Locale.
 java.util.ResourceBundle loadResource(java.lang.String binding, java.lang.String resource)
          After instanciation, this method is needed to provide application's bundles.
 void reload()
          Reload bundles for current Locale, useful after modification will running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Loader

public Loader()
Empty constructor.

Method Detail

loadResource

public java.util.ResourceBundle loadResource(java.lang.String binding,
                                             java.lang.String resource)
After instanciation, this method is needed to provide application's bundles.

Parameters:
binding - a key to retrieve the bundle
resource - path to the bundle
Returns:
the loaded bundle

getBundle

public java.util.ResourceBundle getBundle(java.lang.String binding)
Return a ResourceBundle.

Parameters:
binding - a key to a bundle
Returns:
the bundle tied to the binding

getBundles

public java.util.HashMap getBundles()
Return all ResourceBundles for current Locale.

Returns:
an HashMap of bundles

getBundles

public java.util.HashMap getBundles(java.util.Locale locale)
Return all ResourceBundles for a Locale.

Parameters:
locale - bundles Locale
Returns:
an HashMap of bundles

reload

public void reload()
Reload bundles for current Locale, useful after modification will running.