public abstract class I18nBundleBase extends I18nWrapper implements Serializable
ResourceBundle
into the I18n
delegation chain. For the sake of performance, lookups into the ResourceBundle
are cached by this class in a synchronized map.Constructor and Description |
---|
I18nBundleBase(I18n i18n) |
Modifier and Type | Method and Description |
---|---|
abstract String |
getBundleKey() |
javax.faces.application.FacesMessage |
getFacesMessage(javax.faces.context.FacesContext facesContext,
Locale locale,
javax.faces.application.FacesMessage.Severity severity,
String messageId)
|
javax.faces.application.FacesMessage |
getFacesMessage(javax.faces.context.FacesContext facesContext,
Locale locale,
javax.faces.application.FacesMessage.Severity severity,
String messageId,
Object... arguments)
|
String |
getMessage(javax.faces.context.FacesContext facesContext,
Locale locale,
String messageId)
|
String |
getMessage(javax.faces.context.FacesContext facesContext,
Locale locale,
String messageId,
Object... arguments)
|
I18n |
getWrapped() |
protected Cache<String,String> |
newConcurrentMessageCache(javax.faces.context.ExternalContext externalContext)
Returns a new message cache to be used by
I18nBundleBase . |
public I18nBundleBase(I18n i18n)
public abstract String getBundleKey()
public javax.faces.application.FacesMessage getFacesMessage(javax.faces.context.FacesContext facesContext, Locale locale, javax.faces.application.FacesMessage.Severity severity, String messageId)
I18nWrapper
getFacesMessage
in interface I18n
getFacesMessage
in class I18nWrapper
facesContext
- The current faces context.locale
- The locale of the message.severity
- The severity of the message.messageId
- The id of the message.public javax.faces.application.FacesMessage getFacesMessage(javax.faces.context.FacesContext facesContext, Locale locale, javax.faces.application.FacesMessage.Severity severity, String messageId, Object... arguments)
I18nWrapper
getFacesMessage
in interface I18n
getFacesMessage
in class I18nWrapper
facesContext
- The current faces context.locale
- The locale of the message.severity
- The severity of the message.messageId
- The id of the message.arguments
- The values that are to be inserted according to the MessageFormat
pattern.public String getMessage(javax.faces.context.FacesContext facesContext, Locale locale, String messageId)
I18nWrapper
getMessage
in interface I18n
getMessage
in class I18nWrapper
facesContext
- The current faces context.locale
- The locale of the message.messageId
- The id of the message.public String getMessage(javax.faces.context.FacesContext facesContext, Locale locale, String messageId, Object... arguments)
I18nWrapper
getMessage
in interface I18n
getMessage
in class I18nWrapper
facesContext
- The current faces context.locale
- The locale of the message.messageId
- The id of the message.arguments
- The values that are to be inserted according to the MessageFormat
pattern.public I18n getWrapped()
getWrapped
in interface javax.faces.FacesWrapper<I18n>
getWrapped
in class I18nWrapper
protected Cache<String,String> newConcurrentMessageCache(javax.faces.context.ExternalContext externalContext)
I18nBundleBase
. The default implementation returns a Cache
instance obtained from CacheFactory.getConcurrentCacheInstance(javax.faces.context.ExternalContext, int)
(passing 16 as the initial cache capacity). The cache will be stored in the application map. This method is
called from the constructor of I18nBundleBase, so this method must not cause side effects and should not expect
I18nBundleBase (or its subclass) to be fully initialized.externalContext
- The external context associated with the current FacesContext
.Copyright © 2018 Liferay, Inc.. All rights reserved.