|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.platform.util.messages.LocaleHelper
public class LocaleHelper
Field Summary | |
---|---|
static int |
FORMAT_FULL
|
static int |
FORMAT_IGNORE
|
static int |
FORMAT_LONG
|
static int |
FORMAT_MEDIUM
|
static int |
FORMAT_SHORT
|
static String |
LEFT_TO_RIGHT
|
static String |
UTF_8
|
Constructor Summary | |
---|---|
LocaleHelper()
|
Method Summary | |
---|---|
static String |
convertEncodedStringToSystemDefaultEncoding(String fromEncoding,
String encodedStr)
This method converts strings from a known encoding into a string encoded by the system default encoding. |
static String |
convertISOStringToSystemDefaultEncoding(String isoString)
This method is called to convert strings from ISO-8859-1 (post/get parameters for example) into the default system locale. |
static String |
convertStringEncoding(String sourceString,
String sourceEncoding,
String targetEncoding)
This method converts strings between various encodings. |
static String |
getClosestLocale(String locale,
String[] locales)
|
static NumberFormat |
getCurrencyFormat()
|
static DateFormat |
getDateFormat(int dateFormat,
int timeFormat)
|
static Locale |
getDefaultLocale()
|
static DateFormat |
getFullDateFormat(boolean date,
boolean time)
|
static Locale |
getLocale()
|
static Locale |
getLocaleOverride()
|
static DateFormat |
getLongDateFormat(boolean date,
boolean time)
|
static DateFormat |
getMediumDateFormat(boolean date,
boolean time)
|
static NumberFormat |
getNumberFormat()
|
static DateFormat |
getShortDateFormat(boolean date,
boolean time)
|
static String |
getSystemEncoding()
|
static String |
getTextDirection()
|
static boolean |
isAscii(String aString)
|
static boolean |
isLatin1(String aString)
|
static String |
isoToUtf8(String isoString)
This method converts an ISO-8859-1 encoded string to a UTF-8 encoded string. |
static boolean |
isWithinCharset(String aString,
String charsetTarget)
|
static void |
setDefaultLocale(Locale newLocale)
|
static void |
setLocale(Locale newLocale)
|
static void |
setLocaleOverride(Locale localeOverride)
|
static void |
setSystemEncoding(String encoding)
|
static void |
setTextDirection(String textDirection)
|
static String |
utf8ToIso(String utf8String)
This method converts a UTF8-encoded string to ISO-8859-1 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FORMAT_SHORT
public static final int FORMAT_MEDIUM
public static final int FORMAT_LONG
public static final int FORMAT_FULL
public static final int FORMAT_IGNORE
public static final String UTF_8
public static final String LEFT_TO_RIGHT
Constructor Detail |
---|
public LocaleHelper()
Method Detail |
---|
public static void setDefaultLocale(Locale newLocale)
public static Locale getDefaultLocale()
public static void setLocaleOverride(Locale localeOverride)
public static Locale getLocaleOverride()
public static void setLocale(Locale newLocale)
public static Locale getLocale()
public static void setSystemEncoding(String encoding)
public static void setTextDirection(String textDirection)
public static String getSystemEncoding()
public static String getTextDirection()
public static String convertISOStringToSystemDefaultEncoding(String isoString)
isoString
-
public static String convertEncodedStringToSystemDefaultEncoding(String fromEncoding, String encodedStr)
fromEncoding
- encodedStr
-
public static String isoToUtf8(String isoString)
isoString
-
public static String utf8ToIso(String utf8String)
utf8String
-
public static String convertStringEncoding(String sourceString, String sourceEncoding, String targetEncoding)
sourceString
- sourceEncoding
- targetEncoding
-
public static boolean isAscii(String aString)
aString
-
public static boolean isLatin1(String aString)
aString
-
public static boolean isWithinCharset(String aString, String charsetTarget)
aString
- charsetTarget
-
public static DateFormat getDateFormat(int dateFormat, int timeFormat)
public static DateFormat getShortDateFormat(boolean date, boolean time)
public static DateFormat getMediumDateFormat(boolean date, boolean time)
public static DateFormat getLongDateFormat(boolean date, boolean time)
public static DateFormat getFullDateFormat(boolean date, boolean time)
public static NumberFormat getNumberFormat()
public static NumberFormat getCurrencyFormat()
public static String getClosestLocale(String locale, String[] locales)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |