|
||||||||||
| 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 ILocalizedElement[] |
filter(ILocalizedElement[] 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 ILocalizedElement |
getLocalizedElement(ILocalizedElement[] 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 ILocalizedElement |
getLocalizedElement(ILocalizedElement[] 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 ILocalizedElement[] |
processElementsByDefaultLocales(ILocalizedElement[] elements)
Sorts an array of localized elements using default locales (*). |
protected static ILocalizedElement[] |
processElementsByLocales(ILocalizedElement[] 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 ILocalizedElement[] |
processElementsByLocales(ILocalizedElement[] 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 ILocalizedElement getLocalizedElement(ILocalizedElement[] 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 ILocalizedElement getLocalizedElement(ILocalizedElement[] elements,
java.lang.String[] locales)
elements - locales -
public static ILocalizedElement[] processElementsByLocales(ILocalizedElement[] 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 ILocalizedElement[] processElementsByLocales(ILocalizedElement[] elements,
java.lang.String[] locales)
elements - locales -
public static ILocalizedElement[] processElementsByDefaultLocales(ILocalizedElement[] elements)
protected static ILocalizedElement[] filter(ILocalizedElement[] 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 | |||||||||