net.sf.mmm.util.nls
Class AbstractResourceBundle

java.lang.Object
  extended by java.util.ResourceBundle
      extended by net.sf.mmm.util.nls.AbstractResourceBundle
Direct Known Subclasses:
NlsBundleContentCore, NlsBundleContentRepository, NlsBundlePojo, NlsBundleResource, NlsBundleSearchApi, NlsBundleSynchronizer, NlsBundleUtilCore, NlsBundleUtilReflect, NlsBundleValueCore, NlsBundleValueMain, NlsBundleXml

public abstract class AbstractResourceBundle
extends ResourceBundle

This is the abstract base class for ResourceBundle implementations using this NLS support. Create your ResourceBundles by sub-classing this class and simply define some public static final fields that will be automatically added to the bundle using reflection (only from constructor). Please note that your sub-class must also be public or you need to set privileges in the security manager to allow this class reading the fields via reflection.

Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control
 
Field Summary
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
AbstractResourceBundle()
          The constructor.
 
Method Summary
 String getKey(Object object)
          This method is the inverse of ResourceBundle.getObject(String).
 Enumeration<String> getKeys()
          
protected  Object handleGetObject(String key)
          
 
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, handleKeySet, keySet, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceBundle

public AbstractResourceBundle()
The constructor.

Method Detail

getKey

public String getKey(Object object)
This method is the inverse of ResourceBundle.getObject(String).

Parameters:
object - is the object (potentially) retrieved via ResourceBundle.getObject(String).
Returns:
the key for the given object or null if it was NOT retrieved via ResourceBundle.getObject(String) from this instance.

getKeys

public Enumeration<String> getKeys()

Specified by:
getKeys in class ResourceBundle

handleGetObject

protected Object handleGetObject(String key)

Specified by:
handleGetObject in class ResourceBundle


Copyright © 2001-2008 mmm-Team. All Rights Reserved.