com.g11ntoolkit.util
Class CheckLocale

java.lang.Object
  |
  +--com.g11ntoolkit.util.CheckLocale

public class CheckLocale
extends java.lang.Object

Check a string to see if it is a valid locale name.

Version:
2005/06/20
Author:
Yukitomi Fujinaga, webMethods, Inc.
Copyright © 2001-2002, webMethods Inc. All rights reserved.
, Bill Rich, Wilandra Consulting LLC
Copyright © 2001-2005, Wilandra Consulting LLC. All rights reserved.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See License Agreement.


Field Summary
private static java.util.Hashtable availableLocales
          A list of all available locales in the system.
 
Constructor Summary
CheckLocale()
          Your basic default constructor.
 
Method Summary
 java.util.Locale getLocale(java.lang.String localeString)
          Returns the locale object for the specified string, if the string is a valid locale name.
private static java.util.Hashtable getTable()
          Returns the hashtable of available locales.
 boolean isValid(java.lang.String locale)
          Checks the specified string to see if it is a valid locale name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

availableLocales

private static java.util.Hashtable availableLocales
A list of all available locales in the system.

Constructor Detail

CheckLocale

public CheckLocale()
Your basic default constructor.

Method Detail

isValid

public boolean isValid(java.lang.String locale)
Checks the specified string to see if it is a valid locale name.

Parameters:
locale - a String specifying the locale id to check
Returns:
a boolean true if the specified string contains a locale id that is included in the list of available locales on the system

getLocale

public java.util.Locale getLocale(java.lang.String localeString)
Returns the locale object for the specified string, if the string is a valid locale name.

Parameters:
localeString - a String specifying the locale id
Returns:
a Locale object representing the specified locale id

getTable

private static java.util.Hashtable getTable()
Returns the hashtable of available locales.

Returns:
a Hashtable object representing the available locales