com.ibm.carma.model.util
Class CodePageHelper

java.lang.Object
  extended by com.ibm.carma.model.util.CodePageHelper

public class CodePageHelper
extends java.lang.Object

Helper class used to associate locales with codepages that are valid for the given locale.


Field Summary
static java.lang.String ARABIC_LANG
           
 java.lang.String COPYRIGHT
           
static java.lang.String DEFAULT_ARABIC_LOCALE
           
static java.lang.String DEFAULT_CODE_PAGE
          Default host codepage
 
Constructor Summary
CodePageHelper()
           
 
Method Summary
static java.util.Locale convertStringToLocale(java.lang.String value)
          Converts a string representation of a locale (using the format "language_country_variant") into a java Locale object.
static java.lang.String[] getAllCodepages()
          Returns the complete set of default codepages for all locales
static java.lang.String[] getCodepagesForLocale(java.util.Locale locale)
          Returns the array of default codepages defined for the provided locale
static java.lang.String[] getCodepagesForLocale(java.lang.String locale)
          Returns the array of default codepages defined for the provided locale string
static java.lang.String[] getLocales()
          List the default locales included in the Default codepage set
static boolean hasCodepagesForLocale(java.lang.String locale)
          Returns true if the given locale is included in the default codepage set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public final java.lang.String COPYRIGHT
See Also:
Constant Field Values

DEFAULT_CODE_PAGE

public static final java.lang.String DEFAULT_CODE_PAGE
Default host codepage

See Also:
Constant Field Values

DEFAULT_ARABIC_LOCALE

public static final java.lang.String DEFAULT_ARABIC_LOCALE
See Also:
Constant Field Values

ARABIC_LANG

public static final java.lang.String ARABIC_LANG
See Also:
Constant Field Values
Constructor Detail

CodePageHelper

public CodePageHelper()
Method Detail

getLocales

public static java.lang.String[] getLocales()
List the default locales included in the Default codepage set

Returns:
a sorted list of locale Strings

convertStringToLocale

public static java.util.Locale convertStringToLocale(java.lang.String value)
                                              throws java.lang.IllegalArgumentException
Converts a string representation of a locale (using the format "language_country_variant") into a java Locale object.

Parameters:
value - the string representation of the international locale
Returns:
the Java Locale representation of the international locale
Throws:
java.lang.IllegalArgumentException - The value to convert to a Locale object is not properly formatted

getAllCodepages

public static java.lang.String[] getAllCodepages()
Returns the complete set of default codepages for all locales

Returns:
array of known codepages

getCodepagesForLocale

public static java.lang.String[] getCodepagesForLocale(java.util.Locale locale)
Returns the array of default codepages defined for the provided locale

Parameters:
locale - the locale to return defined codepages for
Returns:
array of codepages defined for the given locale

getCodepagesForLocale

public static java.lang.String[] getCodepagesForLocale(java.lang.String locale)
Returns the array of default codepages defined for the provided locale string

Parameters:
locale - the locale string (formatted XX_YY_ZZ) to return defined codepages for
Returns:
array of codepages defined for the given locale

hasCodepagesForLocale

public static boolean hasCodepagesForLocale(java.lang.String locale)
Returns true if the given locale is included in the default codepage set.

Parameters:
locale - the locale string (formatted XX_YY_ZZ) to search for
Returns:
true if codepages are available, false otherwise