Jwma

dtw.webmail.util.config
Class Internationalization

java.lang.Object
  |
  +--dtw.webmail.util.config.Internationalization
All Implemented Interfaces:
java.io.Serializable

public class Internationalization
extends java.lang.Object
implements java.io.Serializable

Class representing a model for i18n configuration data.

Version:
(created Feb 24, 2003)
Author:
Dieter Wimberger (wimpi)
See Also:
Serialized Form

Constructor Summary
Internationalization()
           
 
Method Summary
 void addViewLanguage(java.lang.String lang)
          Adds a language, specifying it's ISO two letter code.
 void addViewLocale(java.util.Locale locale)
          Adds a view locale.
 java.lang.String getDefaultViewLanguage()
          Returns the default view language in ISO two-letter format.
 java.util.Locale getDefaultViewLocale()
          Returns the default view locale.
 java.lang.String getSystemLanguage()
          Returns the system language in ISO two-letter format.
 java.util.Locale getSystemLocale()
          Returns the system locale.
 java.lang.String getViewLanguageList()
          Convenience method for obtaining the supported languages (represented in ISO two letter code) as a simple comma seperated list.
 boolean isSupportedViewLanguage(java.lang.String lang)
          Tests if a given language (by ISO two letter code) is supported.
 boolean isSupportedViewLocale(java.util.Locale loc)
          Tests if a given locale is supported.
 java.lang.String[] listViewLanguages()
          Returns the list of languages (by their ISO two letter code).
 java.util.Locale[] listViewLocales()
          Returns a list of view languages as locale instances.
 void removeViewLanguage(java.lang.String lang)
          Removes a view language.
 void removeViewLocale(java.util.Locale locale)
          Removes a view locale.
 void setDefaultViewLanguage(java.lang.String language)
          Sets the default view language.
 void setDefaultViewLocale(java.util.Locale locale)
          Sets the default view locale.
 void setSystemLanguage(java.lang.String language)
          Sets the system language.
 void setSystemLocale(java.util.Locale locale)
          Sets the system locale.
 void setViewLanguageList(java.lang.String list)
          Convenience method for setting the supported languages (represented in ISO two letter code) as a simple comma seperated list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Internationalization

public Internationalization()
Method Detail

getSystemLanguage

public java.lang.String getSystemLanguage()
Returns the system language in ISO two-letter format.

Returns:
the language code as String.

setSystemLanguage

public void setSystemLanguage(java.lang.String language)
Sets the system language. The parameter should be an ISO two-letter format string.

Parameters:
language - the language as String.

getSystemLocale

public java.util.Locale getSystemLocale()
Returns the system locale.

Returns:
a Lcoale instance.

setSystemLocale

public void setSystemLocale(java.util.Locale locale)
Sets the system locale.

Parameters:
locale - a Locale instance.

getDefaultViewLanguage

public java.lang.String getDefaultViewLanguage()
Returns the default view language in ISO two-letter format.

Returns:
the language code as String.

setDefaultViewLanguage

public void setDefaultViewLanguage(java.lang.String language)
Sets the default view language. The parameter should be an ISO two-letter format string.

Parameters:
language - the language as String.

getDefaultViewLocale

public java.util.Locale getDefaultViewLocale()
Returns the default view locale.

Returns:
a Lcoale instance.

setDefaultViewLocale

public void setDefaultViewLocale(java.util.Locale locale)
Sets the default view locale.

Parameters:
locale - a Locale instance.

getViewLanguageList

public java.lang.String getViewLanguageList()
Convenience method for obtaining the supported languages (represented in ISO two letter code) as a simple comma seperated list.

Note that this is supposed to be helpful for simplifying the persistency mechanism.

Returns:
the list as String.

setViewLanguageList

public void setViewLanguageList(java.lang.String list)
Convenience method for setting the supported languages (represented in ISO two letter code) as a simple comma seperated list.

Note that this is supposed to be helpful for simplifying the persistency mechanism.

Returns:
the list as String.

listViewLanguages

public java.lang.String[] listViewLanguages()
Returns the list of languages (by their ISO two letter code).

Returns:
the list as String[].

listViewLocales

public java.util.Locale[] listViewLocales()
Returns a list of view languages as locale instances.

Returns:
the view languages as Locale[].

addViewLanguage

public void addViewLanguage(java.lang.String lang)
Adds a language, specifying it's ISO two letter code.

Parameters:
lang - the language as String.

addViewLocale

public void addViewLocale(java.util.Locale locale)
Adds a view locale.

Parameters:
locale - a Locale instance.

removeViewLanguage

public void removeViewLanguage(java.lang.String lang)
Removes a view language.

Parameters:
lang - the language as String.

removeViewLocale

public void removeViewLocale(java.util.Locale locale)
Removes a view locale.

Parameters:
locale - a Locale instance.

isSupportedViewLanguage

public boolean isSupportedViewLanguage(java.lang.String lang)
Tests if a given language (by ISO two letter code) is supported.

Parameters:
lang - a String representing a language.
Returns:
true if supported, false otherwise.

isSupportedViewLocale

public boolean isSupportedViewLocale(java.util.Locale loc)
Tests if a given locale is supported.

Parameters:
loc - a Locale instance.
Returns:
true if supported, false otherwise.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)