Class LocaleUtils
- java.lang.Object
-
- com.googlecode.wicket.jquery.core.utils.LocaleUtils
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_STYLE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetLangageCode(Locale locale)Gets the language-code (eg: xx-XX) from a givenLocalestatic StringgetLocaleDatePattern(Locale locale)Gets the date pattern for the givenLocalestatic StringgetLocaleDatePattern(Locale locale, int style)Gets the date pattern for the givenLocaleand stylestatic StringgetLocaleDatePattern(Locale locale, int style, String defaultPattern)Gets the date pattern for the givenLocaleand stylestatic StringgetLocaleDatePattern(Locale locale, String defaultPattern)Gets the date pattern for the givenLocalestatic StringgetLocaleTimePattern(Locale locale)Gets the time pattern for the givenLocalestatic StringgetLocaleTimePattern(Locale locale, int style)Gets the time pattern for the givenLocaleand stylestatic StringgetLocaleTimePattern(Locale locale, int style, String defaultPattern)Gets the time pattern for the givenLocaleand stylestatic StringgetLocaleTimePattern(Locale locale, String defaultPattern)Gets the time pattern for the givenLocale
-
-
-
Field Detail
-
DEFAULT_STYLE
public static final int DEFAULT_STYLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLangageCode
public static String getLangageCode(Locale locale)
Gets the language-code (eg: xx-XX) from a givenLocale- Parameters:
locale- theLocale- Returns:
- the language-code
-
getLocaleDatePattern
public static String getLocaleDatePattern(Locale locale)
Gets the date pattern for the givenLocale- Parameters:
locale- theLocale- Returns:
- the pattern
-
getLocaleDatePattern
public static String getLocaleDatePattern(Locale locale, int style)
Gets the date pattern for the givenLocaleand style- Parameters:
locale- theLocalestyle- theDateFormatstyle (eg:DateFormat.SHORT,DateFormat.MEDIUM,DateFormat.LONG)- Returns:
- the pattern
-
getLocaleDatePattern
public static String getLocaleDatePattern(Locale locale, String defaultPattern)
Gets the date pattern for the givenLocale- Parameters:
locale- theLocaledefaultPattern- default pattern to be returned if the foundDateFormatis not an instance ofSimpleDateFormat- Returns:
- the pattern
-
getLocaleDatePattern
public static String getLocaleDatePattern(Locale locale, int style, String defaultPattern)
Gets the date pattern for the givenLocaleand style- Parameters:
locale- theLocalestyle- theDateFormatstyle (eg:DateFormat.SHORT,DateFormat.MEDIUM,DateFormat.LONG)defaultPattern- default pattern to be returned if the foundDateFormatis not an instance ofSimpleDateFormat- Returns:
- the pattern
-
getLocaleTimePattern
public static String getLocaleTimePattern(Locale locale)
Gets the time pattern for the givenLocale- Parameters:
locale- theLocale- Returns:
- the pattern
-
getLocaleTimePattern
public static String getLocaleTimePattern(Locale locale, int style)
Gets the time pattern for the givenLocaleand style- Parameters:
locale- theLocalestyle- theDateFormatstyle (eg:DateFormat.SHORT,DateFormat.MEDIUM,DateFormat.LONG)- Returns:
- the pattern
-
getLocaleTimePattern
public static String getLocaleTimePattern(Locale locale, String defaultPattern)
Gets the time pattern for the givenLocale- Parameters:
locale- theLocaledefaultPattern- default pattern to be returned if the foundDateFormatis not an instance ofSimpleDateFormat- Returns:
- the pattern
-
getLocaleTimePattern
public static String getLocaleTimePattern(Locale locale, int style, String defaultPattern)
Gets the time pattern for the givenLocaleand style- Parameters:
locale- theLocalestyle- theDateFormatstyle (eg:DateFormat.SHORT,DateFormat.MEDIUM,DateFormat.LONG)defaultPattern- default pattern to be returned if the foundDateFormatis not an instance ofSimpleDateFormat- Returns:
- the pattern
-
-