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>
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
ConstructorDescriptionSetLocaleCommand
(BiConsumer<C, Locale> localeBiConsumer) Construct a new instance to set the locale into the context. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieve theLocale
stored under the specified context attribute key, and establish it on this response.Return the context attribute key under which we will retrieve the responseLocale
.void
setLocaleKey
(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 theLocale
into 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 theLocale
stored under the specified context attribute key, and establish it on this response.
-