ariba.util.i18n
Class LocaleSupport

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

public final class LocaleSupport
extends java.lang.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 java.lang.String clientSideEncoding(java.util.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(java.util.Locale locale)
          Returns the decomposition flag for the specified locale
static java.lang.String defaultUIEncoding()
           
static java.lang.String fileEncoding(java.util.Locale locale)
          Returns the file encoding string for the specified locale
static int getStringWidth(java.lang.String string, java.util.Locale locale)
          Returns the width of the input string for the specified locale
static boolean isSupportedInEM(java.util.Locale locale)
          Check if the specified locale is supported by EM
static java.lang.String mimeAttachmentEncoding(java.util.Locale locale)
          Returns the MIME HTML attachment encoding string for the specified locale
static java.lang.String mimeBodyCharset(java.util.Locale locale)
          Returns the MIME body charset string for the specified locale
static java.lang.String mimeBodyEncoding(java.util.Locale locale)
          Returns the MIME body encoding string for the specified locale
static java.lang.String mimeHeaderEncoding(java.util.Locale locale)
          Returns the MIME header encoding string for the specified locale
static java.lang.String normalizeCatalog(java.lang.String string, java.util.Locale locale)
          Normalizes characters in the catalog string for the specified locale
static java.lang.String normalizeDate(java.lang.String string, java.util.Locale locale)
          Normalizes the input date format string for the specified locale
static java.lang.String normalizeMailText(java.lang.String string, java.util.Locale locale)
          Normalizes the input mail text string for the specified locale
static java.lang.String normalizeMoney(java.lang.String string, java.util.Locale locale)
          Normalizes the input money format string for the specified locale
static java.lang.String normalizeNumber(java.lang.String string, java.util.Locale locale)
          Normalizes the input decimal string for the specified locale
static java.lang.String readFileText(java.lang.String string, java.util.Locale locale)
          Normalizes the input read text string for the specified locale
static java.lang.String uiEncoding(java.util.Locale locale)
          Returns the UI encoding string for the specified locale
static int widthInBytes(java.lang.String string, java.util.Locale locale)
          Returns the number of bytes of the input string for the specified locale using its default encoding
static java.lang.String writeFileText(java.lang.String string, java.lang.String encoding, java.util.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 java.lang.String uiEncoding(java.util.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 java.lang.String defaultUIEncoding()

fileEncoding

public static java.lang.String fileEncoding(java.util.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 java.lang.String mimeHeaderEncoding(java.util.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 java.lang.String mimeBodyEncoding(java.util.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 java.lang.String mimeBodyCharset(java.util.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 java.lang.String mimeAttachmentEncoding(java.util.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 java.lang.String clientSideEncoding(java.util.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 java.lang.String normalizeCatalog(java.lang.String string,
                                                java.util.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 java.lang.String normalizeDate(java.lang.String string,
                                             java.util.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 java.lang.String normalizeNumber(java.lang.String string,
                                               java.util.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 java.lang.String normalizeMoney(java.lang.String string,
                                              java.util.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 java.lang.String readFileText(java.lang.String string,
                                            java.util.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 java.lang.String writeFileText(java.lang.String string,
                                             java.lang.String encoding,
                                             java.util.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 java.lang.String normalizeMailText(java.lang.String string,
                                                 java.util.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(java.lang.String string,
                               java.util.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(java.lang.String string,
                                 java.util.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(java.util.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(java.util.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-2014 Ariba, Inc. All Rights Reserved.