org.beanfabrics.util
Class ResourceBundleFactory

java.lang.Object
  extended by org.beanfabrics.util.ResourceBundleFactory

public class ResourceBundleFactory
extends java.lang.Object

The ResourceBundleFactory is a factory for ResourceBundle objects by class key.

You can configure this factory to produce a custom ResourceBundle by extending ResourceBundleFactory and using your new class as default factory. This can be done by


Field Summary
static java.lang.String SYSPROPKEY_RESOURCE_BUNDLE_FACTORY
           
 
Constructor Summary
ResourceBundleFactory()
           
 
Method Summary
static java.util.ResourceBundle getBundle(java.lang.Class forClass)
          Returns the ResourceBundle for the given class.
protected  java.util.ResourceBundle getBundleImpl(java.lang.Class forClass)
          Returns the ResourceBundle for the given class.
protected static ResourceBundleFactory getInstance()
          Returns the ResourceBundleFactory.
static
<T extends ResourceBundleFactory>
void
setFactoryClass(java.lang.Class<T> cls)
          Sets the type of the default ResourceBundleFactory to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSPROPKEY_RESOURCE_BUNDLE_FACTORY

public static final java.lang.String SYSPROPKEY_RESOURCE_BUNDLE_FACTORY
Constructor Detail

ResourceBundleFactory

public ResourceBundleFactory()
Method Detail

setFactoryClass

public static final <T extends ResourceBundleFactory> void setFactoryClass(java.lang.Class<T> cls)
Sets the type of the default ResourceBundleFactory to use.

Type Parameters:
T -
Parameters:
cls - the type of the default ResourceBundleFactory to use

getInstance

protected static final ResourceBundleFactory getInstance()
Returns the ResourceBundleFactory.

Returns:
the ResourceBundleFactory

getBundle

public static final java.util.ResourceBundle getBundle(java.lang.Class forClass)
Returns the ResourceBundle for the given class. It is not guaranteed that subsequent calls with the same parameter will return the same instance.

Parameters:
forClass -
Returns:
the ResourceBundle for the given class

getBundleImpl

protected java.util.ResourceBundle getBundleImpl(java.lang.Class forClass)
Returns the ResourceBundle for the given class. It is not guaranteed that subsequent calls with the same parameter will return the same instance.

This method can be overriden to alter the default implementation.

Parameters:
forClass -
Returns:
the ResourceBundle for the given class