|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.i18n.I18nUtils
public class I18nUtils
A utility class for i18n formatting and parsing routing.
Nested Class Summary | |
---|---|
static interface |
I18nUtils.LocaleValidator
Callback interface for findLocale(Map, String, Parameters, Locale, boolean, boolean, boolean, I18nUtils.LocaleValidator) |
Field Summary | |
---|---|
static String |
NAMESPACE_URI
The namespace for i18n is "http://apache.org/cocoon/i18n/2.1". |
static String |
OLD_NAMESPACE_URI
The old namespace for i18n is "http://apache.org/cocoon/i18n/2.0". |
Method Summary | |
---|---|
static Locale |
findLocale(Map objectModel,
String attribute,
Parameters parameters,
Locale defaultLocale,
boolean useLocale)
Find a suitable locale from an objectModel. |
static Locale |
findLocale(Map objectModel,
String attribute,
Parameters parameters,
Locale defaultLocale,
boolean useLocale,
boolean useLocales,
boolean useBlankLocale,
I18nUtils.LocaleValidator test)
Find a suitable locale from an objectModel. |
static boolean |
matchesI18nNamespace(String uri)
|
static Locale |
parseLocale(String localeString)
Parses given locale string to Locale object. |
static Locale |
parseLocale(String localeString,
Locale defaultLocale)
Parses given locale string to Locale object. |
static void |
storeLocale(Map objectModel,
String attribute,
String locale,
boolean storeInRequest,
boolean storeInSession,
boolean storeInCookie,
boolean createSession)
Store locale in request, session, or cookie. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NAMESPACE_URI
public static final String OLD_NAMESPACE_URI
Method Detail |
---|
public static Locale parseLocale(String localeString, Locale defaultLocale)
localeString
- - a string containing locale in
language_country_variant
format.defaultLocale
- - returned if localeString is null
or ""
public static Locale parseLocale(String localeString)
localeString
- a string containing locale in
language_country_variant
format.parseLocale(String, Locale)
,
Locale.getDefault()
public static Locale findLocale(Map objectModel, String attribute, Parameters parameters, Locale defaultLocale, boolean useLocale, boolean useLocales, boolean useBlankLocale, I18nUtils.LocaleValidator test)
public static Locale findLocale(Map objectModel, String attribute, Parameters parameters, Locale defaultLocale, boolean useLocale)
public static void storeLocale(Map objectModel, String attribute, String locale, boolean storeInRequest, boolean storeInSession, boolean storeInCookie, boolean createSession)
public static boolean matchesI18nNamespace(String uri)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |