ariba.util.i18n
Class LocaleSupport

java.lang.Object
  extended by ariba.util.i18n.LocaleSupport

public final class LocaleSupport
extends Object

Class LocaleSupport provides functions for I18N, include getting encoding string, normalize text, etc. All function calls are delegated to instance of the specified language support classes.


Constructor Summary
LocaleSupport()
          Class constructor.
 
Method Summary
static String clientSideEncoding(Locale locale)
          Returns the encoding string for the specified locale to be used for Strings that need to be encoded using the client machine's encoding
static int decompositionFlag(Locale locale)
          Returns the decomposition flag for the specified locale
static String defaultUIEncoding()
           
static String fileEncoding(Locale locale)
          Returns the file encoding string for the specified locale
static int getStringWidth(String string, Locale locale)
          Returns the width of the input string for the specified locale
static boolean isSupportedInEM(Locale locale)
          Check if the specified locale is supported by EM
static String mimeAttachmentEncoding(Locale locale)
          Returns the MIME HTML attachment encoding string for the specified locale
static String mimeBodyCharset(Locale locale)
          Returns the MIME body charset string for the specified locale
static String mimeBodyEncoding(Locale locale)
          Returns the MIME body encoding string for the specified locale
static String mimeHeaderEncoding(Locale locale)
          Returns the MIME header encoding string for the specified locale
static String normalizeCatalog(String string, Locale locale)
          Normalizes characters in the catalog string for the specified locale
static String normalizeDate(String string, Locale locale)
          Normalizes the input date format string for the specified locale
static String normalizeMailText(String string, Locale locale)
          Normalizes the input mail text string for the specified locale
static String normalizeMoney(String string, Locale locale)
          Normalizes the input money format string for the specified locale
static String normalizeNumber(String string, Locale locale)
          Normalizes the input decimal string for the specified locale
static String readFileText(String string, Locale locale)
          Normalizes the input read text string for the specified locale
static String uiEncoding(Locale locale)
          Returns the UI encoding string for the specified locale
static int widthInBytes(String string, Locale locale)
          Returns the number of bytes of the input string for the specified locale using its default encoding
static String writeFileText(String string, String encoding, Locale locale)
          Normalizes the input write text string for the specified locale
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleSupport

public LocaleSupport()
Class constructor.

Method Detail

uiEncoding

public static String uiEncoding(Locale locale)
Returns the UI encoding string for the specified locale

Parameters:
locale - the locale to get the encoding string of
Returns:
the encoding string

defaultUIEncoding

public static String defaultUIEncoding()

fileEncoding

public static String fileEncoding(Locale locale)
Returns the file encoding string for the specified locale

Parameters:
locale - the locale to get the encoding string of
Returns:
the encoding string

mimeHeaderEncoding

public static String mimeHeaderEncoding(Locale locale)
Returns the MIME header encoding string for the specified locale

Parameters:
locale - the locale to get the encoding string of
Returns:
the encoding string

mimeBodyEncoding

public static String mimeBodyEncoding(Locale locale)
Returns the MIME body encoding string for the specified locale

Parameters:
locale - the locale to get the encoding string of
Returns:
the encoding string

mimeBodyCharset

public static String mimeBodyCharset(Locale locale)
Returns the MIME body charset string for the specified locale

Parameters:
locale - the locale to get the encoding string of
Returns:
the encoding string

mimeAttachmentEncoding

public static String mimeAttachmentEncoding(Locale locale)
Returns the MIME HTML attachment encoding string for the specified locale

Parameters:
locale - the locale to get the encoding string of
Returns:
the encoding string

clientSideEncoding

public static String clientSideEncoding(Locale locale)
Returns the encoding string for the specified locale to be used for Strings that need to be encoded using the client machine's encoding

Parameters:
locale - the locale to get the encoding string of
Returns:
the encoding string

normalizeCatalog

public static String normalizeCatalog(String string,
                                      Locale locale)
Normalizes characters in the catalog string for the specified locale

Parameters:
string - the string to be normalized
locale - the locale to normalze the string for
Returns:
the normalized string

normalizeDate

public static String normalizeDate(String string,
                                   Locale locale)
Normalizes the input date format string for the specified locale

Parameters:
string - the string to be normalized
locale - the locale to normalze the string for
Returns:
the normalized string

normalizeNumber

public static String normalizeNumber(String string,
                                     Locale locale)
Normalizes the input decimal string for the specified locale

Parameters:
string - the string to be normalized
locale - the locale to normalze the string for
Returns:
the normalized string

normalizeMoney

public static String normalizeMoney(String string,
                                    Locale locale)
Normalizes the input money format string for the specified locale

Parameters:
string - the string to be normalized
locale - the locale to normalze the string for
Returns:
the normalized string

readFileText

public static String readFileText(String string,
                                  Locale locale)
Normalizes the input read text string for the specified locale

Parameters:
string - the string to be normalized
locale - the locale to normalze the string for
Returns:
the normalized string

writeFileText

public static String writeFileText(String string,
                                   String encoding,
                                   Locale locale)
Normalizes the input write text string for the specified locale

Parameters:
string - the string to be normalized
encoding - the encoding to write the file text
locale - the locale to normalze the string for
Returns:
the normalized string

normalizeMailText

public static String normalizeMailText(String string,
                                       Locale locale)
Normalizes the input mail text string for the specified locale

Parameters:
string - the string to be normalized
locale - the locale to normalze the string for
Returns:
the normalized string

widthInBytes

public static int widthInBytes(String string,
                               Locale locale)
Returns the number of bytes of the input string for the specified locale using its default encoding

Parameters:
string - the string to get the number of bytes
locale - the locale whose default encoding is to be used
Returns:
the width of the string

getStringWidth

public static int getStringWidth(String string,
                                 Locale locale)
Returns the width of the input string for the specified locale

Parameters:
string - the string to get the width of
locale - the locale for calculating width
Returns:
the width of the string

decompositionFlag

public static int decompositionFlag(Locale locale)
Returns the decomposition flag for the specified locale

Parameters:
locale - the locale to get the decomposition flag for
Returns:
the decomposition flag

isSupportedInEM

public static boolean isSupportedInEM(Locale locale)
Check if the specified locale is supported by EM

Parameters:
locale - the locale to be checked
Returns:
true if supported, false otherwise.


AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.