public abstract class LocaleFunctionSupport extends Object implements Function
An abstract base class for Locale-specific extension functions. This class provides convenience methods that can be inherited, specifically to find a Locale from an XPath function argument value.
Constructor and Description |
---|
LocaleFunctionSupport() |
Modifier and Type | Method and Description |
---|---|
protected Locale |
findLocale(String localeText)
Tries to find a Locale instance by name using
RFC 3066
language tags such as 'en', 'en-US', 'en-US-Brooklyn'.
|
protected Locale |
findLocaleForLanguage(String language)
Finds the locale with the given language name with no country
or variant, such as Locale.ENGLISH or Locale.FRENCH
|
protected Locale |
getLocale(Object value,
Navigator navigator)
Attempts to convert the given function argument value
into a Locale either via casting, extracting it from a List
or looking up the named Locale using reflection.
|
protected Locale getLocale(Object value, Navigator navigator)
value
- is either a Locale, a List containing a Locale
or a String containing the name of a Locale
as defined by the Locale static members.protected Locale findLocale(String localeText)
localeText
- the RFC 3066 language tagprotected Locale findLocaleForLanguage(String language)
language
- the language code to look forCopyright 2001–2022 The Jaxen Project. All rights reserved.