|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wookie.w3c.util.LocalizationUtils
public class LocalizationUtils
Utilities for localization
| Constructor Summary | |
|---|---|
LocalizationUtils()
|
|
| Method Summary | |
|---|---|
protected static ILocalized[] |
filter(ILocalized[] elements,
java.util.List<com.ibm.icu.util.ULocale> locales)
Filters a set of elements using the locales and returns a copy of the array containing only elements that match the locales, or that are not localized if there are no matches |
protected static java.util.List<com.ibm.icu.util.ULocale> |
getDefaultLocaleList()
Gets the default locales list |
protected static ILocalized |
getLocalizedElement(ILocalized[] elements,
java.lang.String[] locales)
Returns the first (best) match for an element given the set of locales, or null if there are no suitable elements. |
static ILocalized |
getLocalizedElement(ILocalized[] elements,
java.lang.String[] locales,
java.lang.String defaultLocale)
Returns the first (best) match for an element given the set of locales, or will fall back to the match for defaultLocale if there are no suitable matches, and then to null if there are no elements at all. |
static java.util.List<com.ibm.icu.util.ULocale> |
getProcessedLocaleList(java.lang.String[] locales)
Converts an array of language tags to a list of ULocale instances ordered according to priority, availability and fallback rules. |
static boolean |
isValidLanguageTag(java.lang.String tag)
Validates a given language tag. |
static ILocalized[] |
processElementsByDefaultLocales(ILocalized[] elements)
Sorts an array of localized elements using default locales (*). |
protected static ILocalized[] |
processElementsByLocales(ILocalized[] elements,
java.lang.String[] locales)
Filters and sorts a list of localized elements using the given locale list; only localized elements are returned unless no appropriate localized elements are found, in which case nonlocalized elements are returned |
static ILocalized[] |
processElementsByLocales(ILocalized[] elements,
java.lang.String[] locales,
java.lang.String defaultLocale)
Filters and sorts a list of localized elements using the given locale list; only localized elements are returned unless no appropriate localized elements are found, in which case nonlocalized elements are returned. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocalizationUtils()
| Method Detail |
|---|
public static ILocalized getLocalizedElement(ILocalized[] elements,
java.lang.String[] locales,
java.lang.String defaultLocale)
elements - locales - defaultLocale - the default locale in case none of the supplied locales provide a match
protected static ILocalized getLocalizedElement(ILocalized[] elements,
java.lang.String[] locales)
elements - locales -
public static ILocalized[] processElementsByLocales(ILocalized[] elements,
java.lang.String[] locales,
java.lang.String defaultLocale)
elements - locales - defaultLocale - the default locale in case none of the supplied locales provide a match
protected static ILocalized[] processElementsByLocales(ILocalized[] elements,
java.lang.String[] locales)
elements - locales -
public static ILocalized[] processElementsByDefaultLocales(ILocalized[] elements)
protected static ILocalized[] filter(ILocalized[] elements,
java.util.List<com.ibm.icu.util.ULocale> locales)
elements - locales -
public static java.util.List<com.ibm.icu.util.ULocale> getProcessedLocaleList(java.lang.String[] locales)
locales -
protected static java.util.List<com.ibm.icu.util.ULocale> getDefaultLocaleList()
public static boolean isValidLanguageTag(java.lang.String tag)
tag -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||