Class GetLocaleCommand<C extends WebContext>
java.lang.Object
org.apache.commons.chain.web.javax.GetLocaleCommand<C>
- Type Parameters:
C
- Type of the context associated with this command
- All Implemented Interfaces:
Command<C>
Base
Command
implementation for retrieving the
requested Locale from our Context
, and storing it 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
ConstructorDescriptionGetLocaleCommand
(Function<C, Locale> localeFunction) Construct a new instance to get the locale from the context. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieve theLocale
for this request, and store it under the specified context attribute.Return the context attribute key under which we will store the requestLocale
.void
setLocaleKey
(String localeKey) Set the context attribute key under which we will store the requestLocale
.
-
Constructor Details
-
GetLocaleCommand
Construct a new instance to get the locale from the context.- Parameters:
localeFunction
- Function to get theLocale
from thecontext
-
-
Method Details
-
getLocaleKey
Return the context attribute key under which we will store the requestLocale
.- Returns:
- The context attribute key of the request
Locale
.
-
setLocaleKey
Set the context attribute key under which we will store the requestLocale
.- Parameters:
localeKey
- The new context attribute key
-
execute
Retrieve theLocale
for this request, and store it under the specified context attribute.
-