Class GetLocaleCommand<C extends WebContext>
java.lang.Object
org.apache.commons.chain.web.jakarta.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
ConstructorsConstructorDescriptionGetLocaleCommand(Function<C, Locale> localeFunction) Construct a new instance to get the locale from the context. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieve theLocalefor this request, and store it under the specified context attribute.Return the context attribute key under which we will store the requestLocale.voidsetLocaleKey(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 theLocalefrom 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 theLocalefor this request, and store it under the specified context attribute.
-