|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.araneaframework.core.BaseComponent
org.araneaframework.core.BaseService
org.araneaframework.framework.core.BaseFilterService
org.araneaframework.framework.filter.StandardLocalizationFilterService
public class StandardLocalizationFilterService
Enriches the environment with an implementation of the
LocalizationContext. Children can use
it and thus provide Locale specific content.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseService |
|---|
BaseService.ServiceImpl |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseComponent |
|---|
BaseComponent.ComponentImpl |
| Nested classes/interfaces inherited from interface org.araneaframework.framework.LocalizationContext |
|---|
LocalizationContext.LocaleChangeListener |
| Nested classes/interfaces inherited from interface org.araneaframework.Service |
|---|
Service.Interface |
| Field Summary |
|---|
| Fields inherited from class org.araneaframework.framework.core.BaseFilterService |
|---|
childService |
| Fields inherited from class org.araneaframework.core.BaseService |
|---|
currentInputData, currentOutputData |
| Constructor Summary | |
|---|---|
StandardLocalizationFilterService()
|
|
| Method Summary | |
|---|---|
void |
addLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
protected Environment |
getChildEnvironment()
Returns the Environment of this service by default. |
Locale |
getLocale()
Returns the current session locale. |
String |
getMessage(String code,
Object[] args)
Localizes the code and uses it to format the message with the passed arguments. |
String |
getMessage(String code,
Object[] args,
String defaultMessage)
Localizes the code and uses it to format the message with the passed arguments. |
ResourceBundle |
getResourceBundle()
Returns a resource bundle corresponding to the current locale. |
ResourceBundle |
getResourceBundle(Locale locale)
Gets a resource bundle using the specified resource bundle name and current locale and the ClassLoaders provided by the ClassLoaderUtil. |
protected void |
init()
Init callback. |
String |
localize(String key)
Localizes a string returning one that corresponds to the current locale. |
protected void |
notifyLocaleChangeListeners(Locale oldLocale,
Locale newLocale)
|
boolean |
removeLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
void |
setLanguageName(String languageName)
Set the name of the language, it must be a valid ISO Language Code. |
void |
setLocale(Locale currentLocale)
Sets the current session locale. |
void |
setResourceBundleName(String resourceBundleName)
Sets the name of the resource bundle. |
| Methods inherited from class org.araneaframework.framework.core.BaseFilterService |
|---|
action, destroy, propagate, setChildService |
| Methods inherited from class org.araneaframework.core.BaseService |
|---|
_getService, getInputData, getOutputData, handleServiceException |
| Methods inherited from class org.araneaframework.core.BaseComponent |
|---|
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getComponent, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, disable, enable, getEnvironment, getScope, handleException, isAlive, isDead, isInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.araneaframework.Service |
|---|
_getService |
| Methods inherited from interface org.araneaframework.Component |
|---|
_getComponent, getEnvironment, getScope, isAlive |
| Constructor Detail |
|---|
public StandardLocalizationFilterService()
| Method Detail |
|---|
public void setLanguageName(String languageName)
Locale. This method should only be used
when country and variant are not important at all,
otherwise setLocale(Locale) must be used.
public void setResourceBundleName(String resourceBundleName)
resourceBundleName - public Locale getLocale()
LocalizationContext
getLocale in interface LocalizationContextpublic void setLocale(Locale currentLocale)
LocalizationContext
setLocale in interface LocalizationContextprotected Environment getChildEnvironment()
BaseFilterService
getChildEnvironment in class BaseFilterServicepublic ResourceBundle getResourceBundle()
LocalizationContext
getResourceBundle in interface LocalizationContext
protected void init()
throws Exception
BaseComponent
init in class BaseFilterServiceException - Any runtime exception that may occur.public ResourceBundle getResourceBundle(Locale locale)
getResourceBundle in interface LocalizationContextpublic String localize(String key)
LocalizationContext
localize in interface LocalizationContext
public String getMessage(String code,
Object[] args)
LocalizationContextjava.text.MessageFormat.
getMessage in interface LocalizationContext
public String getMessage(String code,
Object[] args,
String defaultMessage)
LocalizationContextjava.text.MessageFormat.
If the localized message cannot be resolved uses defaultMessage instead.
getMessage in interface LocalizationContextpublic void addLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
addLocaleChangeListener in interface LocalizationContextpublic boolean removeLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
removeLocaleChangeListener in interface LocalizationContext
protected void notifyLocaleChangeListeners(Locale oldLocale,
Locale newLocale)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||