| java.lang.Object de.odysseus.calyxo.base.I18nSupport
All known Subclasses: de.odysseus.calyxo.struts.base.StrutsI18nSupport, de.odysseus.calyxo.base.test.TestI18nSupport, de.odysseus.calyxo.control.impl.DefaultI18nSupport,
I18nSupport | abstract public class I18nSupport (Code) | | Abstract internationalization support class. There is one instance
per module, which may be retreived via the getInstance()
methods.
I18n support includes determination of a request's desired locale,
resource lookup and message construction(a message is a resource
with parameters).
The basic principle here is, that internationalized content may be
determined by specifying a locale, a bundle name and a resource key.
Beyond that, there are no further requirements.
Bundle aliases may be registered using the addBundleAlias
method.
author: Christoph Beck |
Field Summary | |
final public static String | I18N_SUPPORT_KEY Module scope key where the i18n support instance is stored. |
Method Summary | |
final public static I18nSupport | getInstance(HttpServletRequest request) | final public static I18nSupport | getInstance(PageContext pageContext) Convenience method. | final public static I18nSupport | getInstance(ModuleContext context) | abstract public Locale | getLocale(HttpServletRequest request) Get the desired locale for the specified request. | final public Locale | getLocale(PageContext pageContext) Convenience method. | final public String | getMessage(Locale locale, String bundle, String key, Object[] args) | final public String | getResource(Locale locale, String bundle, String key) Get a resource string. | abstract protected String | lookupMessage(Locale locale, String bundle, String key, Object[] args) | abstract protected String | lookupResource(Locale locale, String bundle, String key) Lookup a resource string. | public String | resolveBundle(String bundle) Get unaliased bundle name.
Parameters: bundle - the bundle name or alias if the specified bundle name is an alias set with I18nSupport.setBundleAlias(String,String),the associated name is returned. | public void | setBundleAlias(String alias, String bundle) Set bundle alias.
When resolving resources and messages, bundle names may be
aliased. | abstract public void | setLocale(HttpServletRequest request, Locale locale) Set the desired locale for the specified request. | public void | setLocale(PageContext pageContext, Locale locale) Convenience method. |
I18N_SUPPORT_KEY | final public static String I18N_SUPPORT_KEY(Code) | | Module scope key where the i18n support instance is stored.
|
getLocale | abstract public Locale getLocale(HttpServletRequest request)(Code) | | Get the desired locale for the specified request.
An implementation may choose to cache the locale
in session scope and answer that value here.
|
getMessage | final public String getMessage(Locale locale, String bundle, String key, Object[] args)(Code) | | Get a message string
Parameters: locale - the desired locale Parameters: bundle - the bundle name or alias Parameters: key - the resource key Parameters: args - message arguments message string |
getResource | final public String getResource(Locale locale, String bundle, String key)(Code) | | Get a resource string.
Parameters: locale - the desired locale Parameters: bundle - the bundle name or alias Parameters: key - the resource key resource string |
lookupMessage | abstract protected String lookupMessage(Locale locale, String bundle, String key, Object[] args)(Code) | | Lookup a message string
Parameters: locale - the desired locale Parameters: bundle - the bundle name Parameters: key - the resource key Parameters: args - message arguments message string |
lookupResource | abstract protected String lookupResource(Locale locale, String bundle, String key)(Code) | | Lookup a resource string.
Parameters: locale - the desired locale Parameters: bundle - the bundle name Parameters: key - the resource key resource string |
resolveBundle | public String resolveBundle(String bundle)(Code) | | Get unaliased bundle name.
Parameters: bundle - the bundle name or alias if the specified bundle name is an alias set with I18nSupport.setBundleAlias(String,String),the associated name is returned. Otherwise, the specified bundle name is returned. |
setLocale | abstract public void setLocale(HttpServletRequest request, Locale locale)(Code) | | Set the desired locale for the specified request.
An implementation may choose to cache the locale set here
in session scope and answer that value in subsequent calls
of getLocale() methods.
|
|
|