org.jwarp.service.localization
Class Localization

java.lang.Object
  |
  +--org.jwarp.service.localization.Localization
All Implemented Interfaces:
IConfigurable, ILocalization

public class Localization
extends java.lang.Object
implements ILocalization

Localization helper class.

Version:
1.0
Author:
Anatole Tresch

Field Summary
protected  java.lang.String defaultCountry
          The default country
protected  java.lang.String defaultLanguage
          The default language
 
Constructor Summary
Localization()
          Constructor.
 
Method Summary
 void configure(org.jdom.Element config)
          Constructor.
 java.util.ResourceBundle getBundle(java.lang.String bundleName)
          This method returns a ResourceBundle given the bundle name and the default Locale information supplied in TurbineProperties.
 java.util.ResourceBundle getBundle(java.lang.String bundleName, java.util.Locale locale)
          This method returns a ResourceBundle for the given bundle name and the given Locale.
 java.util.ResourceBundle getDefaultBundle()
          This method returns a ResourceBundle given the bundle name "DEFAULT" and the default Locale information supplied in TurbineProperties.
 java.lang.String getString(java.lang.String key)
          Get the string resource from the default bundle.
 void setDefaultBundle(java.lang.String defaultBundle)
          This method sets the name of the defaultBundle.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultLanguage

protected java.lang.String defaultLanguage
The default language

defaultCountry

protected java.lang.String defaultCountry
The default country
Constructor Detail

Localization

public Localization()
Constructor.
Method Detail

configure

public void configure(org.jdom.Element config)
               throws ConfigurationException
Constructor.
Specified by:
configure in interface IConfigurable
Following copied from interface: org.jwarp.service.configuration.IConfigurable
Parameters:
configuration - the class configurations.

getString

public java.lang.String getString(java.lang.String key)
Get the string resource from the default bundle.
Specified by:
getString in interface ILocalization
Parameters:
key - The key
Returns:
The string resource

getDefaultBundle

public java.util.ResourceBundle getDefaultBundle()
This method returns a ResourceBundle given the bundle name "DEFAULT" and the default Locale information supplied in TurbineProperties.
Specified by:
getDefaultBundle in interface ILocalization
Returns:
A localized ResourceBundle.

getBundle

public java.util.ResourceBundle getBundle(java.lang.String bundleName)
This method returns a ResourceBundle given the bundle name and the default Locale information supplied in TurbineProperties.
Specified by:
getBundle in interface ILocalization
Parameters:
bundleName - Name of bundle.
Returns:
A localized ResourceBundle.

getBundle

public java.util.ResourceBundle getBundle(java.lang.String bundleName,
                                          java.util.Locale locale)
This method returns a ResourceBundle for the given bundle name and the given Locale.
Specified by:
getBundle in interface ILocalization
Parameters:
bundleName - Name of bundle.
locale - A Locale.
Returns:
A localized ResourceBundle.

setDefaultBundle

public void setDefaultBundle(java.lang.String defaultBundle)
This method sets the name of the defaultBundle.
Specified by:
setDefaultBundle in interface ILocalization
Parameters:
defaultBundle - Name of default bundle.

©   O R C A   S y s t e m s