de.kosi.util
Class UserResourceBundle

java.lang.Object
  |
  +--de.kosi.util.UserResourceBundle

public class UserResourceBundle
extends java.lang.Object

UserResourceBundle is a ResourceBundle, that returns a resource for the current user. If ServerSessionInformation.getUser().getLocale() does throw an exception, the resource is returned for the default Locale of the Java VM. UserResourceBundles can not be created by invoking a constructor. Use UserResourceBundle.getBundle() to obtain a reference to a bundle.

ChangeLog:

 $Log: UserResourceBundle.java,v $
 Revision 1.2  2001/05/22 20:24:40  jiriki
 Made source more conformant to Coding Conventions.

 Revision 1.1.1.1  2001/04/29 18:05:20  jiriki
 Imported sources from zola.

 Revision 1.1  2001/04/24 23:19:22  wombat
 - Implemented I18N features of server
 - Implemented actions for Admin Client
 - Other changes is AdminClient

 

Version:
$Revision: 1.2 $ ($Date: 2001/05/22 20:24:40 $)
Author:
Jan-Ole Janssen, Timo Sticher, Niklas Mehner

Method Summary
static UserResourceBundle getBundle(java.lang.String name)
          Return the UserResourceBundle for a given name.
 java.util.Enumeration getKeys()
          Returns the keys of the ResourceBundle for the currently active Locale.
 java.util.Locale getLocale()
          Return the current active locale.
 java.lang.String getString(java.util.Locale locale, java.lang.String key)
          Return a resource for a given locale.
protected  java.lang.Object handleGetObject(java.lang.String key)
          Return a object for the currently active locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getString

public java.lang.String getString(java.util.Locale locale,
                                  java.lang.String key)
                           throws java.util.MissingResourceException
Return a resource for a given locale. This method can be used to obtain resources, for a locale, when the session context is not valid.
Parameters:
locale - Locale the resource is returned for.
key - Key the resource is returned for.
Returns:
A resource.
Throws:
java.util.MissingResourceException - If the resource is not available.

getLocale

public java.util.Locale getLocale()
Return the current active locale. Notice that this might change, if the session context changes.
Returns:
The currently active Locale.

handleGetObject

protected java.lang.Object handleGetObject(java.lang.String key)
                                    throws java.util.MissingResourceException
Return a object for the currently active locale.
Parameters:
key - Key the object is returned for.
Returns:
Object the key mapped to.
Throws:
java.util.MissingResourceException - If the key does not exists in this resource.

getKeys

public java.util.Enumeration getKeys()
Returns the keys of the ResourceBundle for the currently active Locale.
Returns:
Enumeration of Strings.

getBundle

public static UserResourceBundle getBundle(java.lang.String name)
Return the UserResourceBundle for a given name.
Parameters:
name - Name of the resource bundle.
Returns:
A UserResourceBundle.