Class SetLocaleCommand<C extends WebContext>
java.lang.Object
org.apache.commons.chain.web.javax.SetLocaleCommand<C>
- Type Parameters:
C- Type of the context associated with this command
- All Implemented Interfaces:
Command<C>
- Direct Known Subclasses:
FacesSetLocaleCommand,PortletSetLocaleCommand,ServletSetLocaleCommand
Base
Command implementation for setting the
response locale for this response to the Locale stored
under the context attribute key returned by the localeKey
property.- Since:
- Chain 1.3
- Author:
- Stefan Graff
-
Field Summary
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE -
Constructor Summary
ConstructorsConstructorDescriptionSetLocaleCommand(BiConsumer<C, Locale> localeBiConsumer) Construct a new instance to set the locale into the context. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieve theLocalestored under the specified context attribute key, and establish it on this response.Return the context attribute key under which we will retrieve the responseLocale.voidsetLocaleKey(String localeKey) Set the context attribute key under which we will retrieve the responseLocale.
-
Constructor Details
-
SetLocaleCommand
Construct a new instance to set the locale into the context.- Parameters:
localeBiConsumer- BiConsumer to set theLocaleinto thecontext
-
-
Method Details
-
getLocaleKey
Return the context attribute key under which we will retrieve the responseLocale.- Returns:
- The context attribute key of the request
Locale.
-
setLocaleKey
Set the context attribute key under which we will retrieve the responseLocale.- Parameters:
localeKey- The new context attribute key
-
execute
Retrieve theLocalestored under the specified context attribute key, and establish it on this response.
-