org.openmobileis.common.intl
Class IntlResourceManager

java.lang.Object
  extended byorg.openmobileis.common.intl.IntlResourceManager

public final class IntlResourceManager
extends java.lang.Object

Title: OpenMobileIS project source
Description: Manage international resource.

Since:
JDK 1.1
Version:
1.0.
Author:
Philippe Delrieu

Field Summary
static java.lang.String BE
          Belgium local extension :be
static java.lang.String DE
          Deutchland local extension :de
static java.lang.String DEFAULT
          default extension extension : nothing
static java.lang.String EN
          England local extension :en
static java.lang.String ES
          Espana local extension :es
static java.lang.String FR
          France local extension :fr
static java.lang.String IT
          Italian local extension :it
static java.lang.String SW
          Switzerland local extension :sw
static java.lang.String US
          United State local extension :us
 
Method Summary
 void addLocalizedProperties(java.lang.String propertiesFile, java.lang.String local)
          load the properties file with specified locale in the IntlResourceManager properties .
 java.lang.String getLocalizedFileName(java.lang.String fileName)
          return the fileName transformed with the system local.
 java.lang.String getLocalizedProperty(java.lang.String propKey)
           
 java.lang.String getLocalizedProperty(java.lang.String propKey, java.lang.String defaultValue)
           
static IntlResourceManager getManager()
           
 java.util.Locale getManagerLocale()
           
 java.lang.String getManagerLocaleString()
          return the local defined in the webserver property server.locale.
 java.util.Properties loadLocalizedProperties(java.lang.String fileName, java.lang.String local)
          load the properties file with specified locale.
 java.lang.String removeLocaleFromFileName(java.lang.String fileName)
          return the fileName without the current locale extension if present.
 void setLocalizedProperty(java.lang.String key, java.lang.String value)
           
 void setManagerLocal(java.lang.String local)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final java.lang.String DEFAULT
default extension extension : nothing

See Also:
Constant Field Values

FR

public static final java.lang.String FR
France local extension :fr

See Also:
Constant Field Values

US

public static final java.lang.String US
United State local extension :us

See Also:
Constant Field Values

EN

public static final java.lang.String EN
England local extension :en

See Also:
Constant Field Values

BE

public static final java.lang.String BE
Belgium local extension :be

See Also:
Constant Field Values

SW

public static final java.lang.String SW
Switzerland local extension :sw

See Also:
Constant Field Values

DE

public static final java.lang.String DE
Deutchland local extension :de

See Also:
Constant Field Values

IT

public static final java.lang.String IT
Italian local extension :it

See Also:
Constant Field Values

ES

public static final java.lang.String ES
Espana local extension :es

See Also:
Constant Field Values
Method Detail

getManager

public static IntlResourceManager getManager()

loadLocalizedProperties

public java.util.Properties loadLocalizedProperties(java.lang.String fileName,
                                                    java.lang.String local)
                                             throws java.io.FileNotFoundException,
                                                    java.io.IOException
load the properties file with specified locale. Localized filename are of type filename.localExtension. If the localised file is not found try to load the filename (without extension). If it's failed return java.io.FileNotFoundException.

Parameters:
local - : locale of the file to load
Throws:
: - java.io.FileNotFoundException if the localized file and fileName is not found.
: - java.io.IOException if an error occurs.
java.io.FileNotFoundException
java.io.IOException

getLocalizedFileName

public java.lang.String getLocalizedFileName(java.lang.String fileName)
return the fileName transformed with the system local. (ie:fileName.systemlocal). if the localized file does not exist return the specified filename.


removeLocaleFromFileName

public java.lang.String removeLocaleFromFileName(java.lang.String fileName)
return the fileName without the current locale extension if present. if not return the file name.


addLocalizedProperties

public void addLocalizedProperties(java.lang.String propertiesFile,
                                   java.lang.String local)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
load the properties file with specified locale in the IntlResourceManager properties . Localized filename are of type filename.localExtension. If the localised file is not found try to load the filename (without extension). If it's failed return java.io.FileNotFoundException.

Parameters:
local - : locale of the file to load
Throws:
: - java.io.FileNotFoundException if the localized file and fileName is not found.
: - java.io.IOException if an error occurs.
java.io.FileNotFoundException
java.io.IOException

getLocalizedProperty

public java.lang.String getLocalizedProperty(java.lang.String propKey)

setLocalizedProperty

public void setLocalizedProperty(java.lang.String key,
                                 java.lang.String value)

getLocalizedProperty

public java.lang.String getLocalizedProperty(java.lang.String propKey,
                                             java.lang.String defaultValue)

getManagerLocaleString

public java.lang.String getManagerLocaleString()
return the local defined in the webserver property server.locale. If not defined default is use.


setManagerLocal

public void setManagerLocal(java.lang.String local)

getManagerLocale

public java.util.Locale getManagerLocale()


Copyright 2005 e-Care. All Rights Reserved.