|
TPTP 4.6.0 Platform Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.hyades.internal.logging.core.internationalization.InternationalizationUtilities
public final class InternationalizationUtilities
Internationalization utilities facade class containing operations to eliminate the International Components for Unicode (ICU) dependency in some run-times.
| Field Summary | |
|---|---|
protected static boolean |
isICUAvailable
Static flag for quickly determining if the ICU classes are available on the classpath. |
| Constructor Summary | |
|---|---|
InternationalizationUtilities()
|
|
| Method Summary | |
|---|---|
static char |
charAt(java.lang.String string,
int index)
Returns the char value at the specified index for a given String. |
static java.lang.String |
format(long milliseconds,
java.lang.String dateFormatPattern,
com.ibm.icu.util.ULocale locale,
java.lang.String timeZoneID)
Resolves the formatted date string associated with the parameter long representing a Coordinated Universal Time (UTC) date in milliseconds using the parameter date format pattern based on the parameter Locale and time zone ID. |
static java.lang.String |
format(java.lang.String message,
java.lang.Object[] arguments)
Resolves the formatted message associated with the localized parameter message
and message parameters based on the default locale. |
static java.lang.String |
format(java.lang.String message,
java.lang.Object[] arguments,
com.ibm.icu.util.ULocale locale)
Resolves the formatted message associated with the localized parameter message
and message parameters based on the parameter Locale. |
static java.lang.String[] |
tokenize(java.lang.String string)
Tokenizes the parameter String to an array of tokens based on the following separating token characters:
Space (e.g. ' ')
Tab (e.g. |
static java.lang.String[] |
tokenize(java.lang.String string,
java.lang.String delimiters)
Tokenizes the parameter String to an array of
tokens based on the separating token characters
in the delimiters parameter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static boolean isICUAvailable
By default, the ICU classes are assumed to be available on the classpath.
| Constructor Detail |
|---|
public InternationalizationUtilities()
| Method Detail |
|---|
public static java.lang.String format(long milliseconds,
java.lang.String dateFormatPattern,
com.ibm.icu.util.ULocale locale,
java.lang.String timeZoneID)
throws java.lang.IllegalArgumentException
Locale and time zone ID.
When the International Components for Unicode (ICU) JAR(s)
are available on the class path at run-time, date formatting is done by the
SimpleDateFormat class using the ULocale (parameter Locale
converted to a ULocale - see ULocale.forLocale(Locale)),
GregorianCalendar and TimeZone (parameter time zone ID
converted to a TimeZone - see TimeZone.getTimeZone(String)) classes,
otherwise date formatting is done by the SimpleDateFormat class using the Locale,
GregorianCalendar and TimeZone classes. That is, if the
International Components for Unicode (ICU) JAR(s)
are available on the class path at run-time, the parameter date format pattern is based on the syntax and symbols
as specified in the class comment header of the SimpleDateFormat class, otherwise the
parameter date format pattern is based on the syntax and symbols as specified in the class comment header of the
java.util.SimpleDateFormat class. Also, if the International Components for Unicode (ICU)
JAR(s) are available on the class path at run-time, the parameter time zone ID is based on the syntax
as specified in the class comment header of the TimeZone class, otherwise the
parameter time zone ID is based on the syntax as specified in the class comment header of the
TimeZone class.
milliseconds - A long representing a Coordinated Universal Time (UTC) time stamp in milliseconds.dateFormatPattern - The date format pattern.locale - The Locale for date formatting.timeZoneID - The time zone ID for date formatting.
java.lang.IllegalArgumentException - If the date format pattern is invalid.SimpleDateFormat,
Locale,
GregorianCalendar,
TimeZone,
SimpleDateFormat,
ULocale,
GregorianCalendar,
TimeZone,
format(long, String, com.ibm.icu.util.ULocale, String)
public static java.lang.String format(java.lang.String message,
java.lang.Object[] arguments)
throws java.lang.IllegalArgumentException
message
and message parameters based on the default locale.
When the International Components for Unicode (ICU) JAR(s)
are available on the class path at run-time, message formatting is done by the
MessageFormat class using the ULocale class,
otherwise message formatting is done by the MessageFormat class using the Locale
class.
message - The localized message to be formatted.arguments - The array of message parameters for formatting in the localized and formatted message.
java.lang.IllegalArgumentException - If the localized message is invalid and cannot be formatted.MessageFormat,
Locale,
MessageFormat,
ULocale,
InternationalizationUtilities#format(String, Object[], java.util.Locale),
format(String, Object[], com.ibm.icu.util.ULocale)
public static java.lang.String format(java.lang.String message,
java.lang.Object[] arguments,
com.ibm.icu.util.ULocale locale)
throws java.lang.IllegalArgumentException
message
and message parameters based on the parameter Locale.
When the International Components for Unicode (ICU) JAR(s)
are available on the class path at run-time, message formatting is done by the
MessageFormat class using the ULocale class (parameter Locale
converted to a ULocale - see ULocale.forLocale(Locale)),
otherwise message formatting is done by the MessageFormat class using the Locale
class.
message - The localized message to be formatted.arguments - The array of message parameters for formatting in the localized and formatted message.locale - The Locale for message formatting.
java.lang.IllegalArgumentException - If the localized message is invalid and cannot be formatted.MessageFormat,
Locale,
MessageFormat,
ULocale,
format(String, Object[], com.ibm.icu.util.ULocale)public static java.lang.String[] tokenize(java.lang.String string)
String to an array of tokens based on the following separating token characters:
The separating token characters are not returned.
When the International Components for Unicode (ICU) JAR(s) are
available on the class path at run-time, the StringTokenizer class is used, otherwise
the StringTokenizer class is used.
string - The String to be tokenized.
String, otherwise null.StringTokenizer,
StringTokenizer,
tokenize(String, String)
public static java.lang.String[] tokenize(java.lang.String string,
java.lang.String delimiters)
String to an array of
tokens based on the separating token characters
in the delimiters parameter. The separating
token characters are not returned.
When the International Components for
Unicode (ICU) JAR(s) are available on the class path at run-time, the
StringTokenizer class is used, otherwise the
StringTokenizer class is used.
string - The String to be tokenized.delimiters - The separating token characters.
String, otherwise null.StringTokenizer,
StringTokenizer
public static char charAt(java.lang.String string,
int index)
throws java.lang.IndexOutOfBoundsException
When the International Components for
Unicode (ICU) JAR(s) are available on the class path at run-time, the
UTF16 class is used, otherwise the
String class is used.
string - The String to get the char value at the specified index from.index - the index of the char value.
java.lang.IndexOutOfBoundsExceptionString,
UTF16
|
TPTP 4.6.0 Platform Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||