org.jfree.report.i18n

Class DefaultResourceBundleFactory

Implemented Interfaces:
ResourceBundleFactory, Serializable

public class DefaultResourceBundleFactory
extends java.lang.Object
implements ResourceBundleFactory

A default implementation of the ResourceBundleFactory, that creates resource bundles using the specified locale.

If not defined otherwise, this implementation uses Locale.getDefault() as Locale.

Author:
Thomas Morgner

Fields inherited from interface org.jfree.report.i18n.ResourceBundleFactory

DEFAULT_RESOURCE_BUNDLE_CONFIG_KEY

Constructor Summary

DefaultResourceBundleFactory()
Creates a new DefaultResourceBundleFactory using the system's default locale as factory locale.

Method Summary

ResourceBundle
getResourceBundle(Locale locale, String key)
Creates a resource bundle named by the given key and using the factory's defined locale.

Constructor Details

DefaultResourceBundleFactory

public DefaultResourceBundleFactory()
Creates a new DefaultResourceBundleFactory using the system's default locale as factory locale.

Method Details

getResourceBundle

public ResourceBundle getResourceBundle(Locale locale,
                                        String key)
Creates a resource bundle named by the given key and using the factory's defined locale.
Specified by:
getResourceBundle in interface ResourceBundleFactory
Parameters:
key - the name of the resourcebundle, never null.
Returns:
the created resource bundle
See Also:
ResourceBundle.getBundle(String,Locale)