net.xoetrope.optional.langmgr
Class EncodedResourceBundle

java.lang.Object
  extended by java.util.ResourceBundle
      extended by net.xoetrope.optional.langmgr.EncodedResourceBundle
All Implemented Interfaces:
ResourceBundleEx

public class EncodedResourceBundle
extends java.util.ResourceBundle
implements ResourceBundleEx

Load a resource bundle that reads a file with a specified file encoding. The encoding can be specified using an ancillary file with the suffix ".property_encodings" for the particular language resource bundle, or the EncodedLanguageResourceBundleLoader.setEncoding can be called prior to loading the resource. The ".property_encodings" takes precedence. The ".property_encodings" file may also specify font mappings associated with a particular language, so that locale specific fonts can be used instead of the default font.

Copyright (c) Xoetrope Ltd., 2002-2006, see license.txt for licesning information

$Revision: 1.2 $


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.ResourceBundle
java.util.ResourceBundle.Control
 
Field Summary
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
EncodedResourceBundle(java.io.BufferedReader reader, java.util.Hashtable encProps)
          Creates a property resource bundle.
 
Method Summary
 java.util.Hashtable getEncodingProperties()
          Get the encoding properties.
 java.util.Enumeration getKeys()
          Implementation of ResourceBundle.getKeys.
 java.lang.Object handleGetObject(java.lang.String key)
           
protected  void loadProperties(java.util.Properties properties, java.io.BufferedReader reader)
           
 
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

EncodedResourceBundle

public EncodedResourceBundle(java.io.BufferedReader reader,
                             java.util.Hashtable encProps)
                      throws java.io.IOException,
                             java.io.UnsupportedEncodingException
Creates a property resource bundle.

Parameters:
stream - reader property file to read from.
Throws:
java.io.IOException
java.io.UnsupportedEncodingException
Method Detail

handleGetObject

public java.lang.Object handleGetObject(java.lang.String key)
Specified by:
handleGetObject in class java.util.ResourceBundle

getEncodingProperties

public java.util.Hashtable getEncodingProperties()
Get the encoding properties.

Specified by:
getEncodingProperties in interface ResourceBundleEx
Returns:
the extra encoding properties associated with this resource bundle

getKeys

public java.util.Enumeration getKeys()
Implementation of ResourceBundle.getKeys.

Specified by:
getKeys in class java.util.ResourceBundle

loadProperties

protected void loadProperties(java.util.Properties properties,
                              java.io.BufferedReader reader)
                       throws java.io.IOException
Throws:
java.io.IOException