Package io.jmix.core.impl.method
Class LocaleArgumentResolver
java.lang.Object
io.jmix.core.impl.method.TypedArgumentResolver<Locale>
io.jmix.core.impl.method.LocaleArgumentResolver
- All Implemented Interfaces:
MethodArgumentResolver
@Component("core_LocaleArgumentResolver")
public class LocaleArgumentResolver
extends TypedArgumentResolver<Locale>
Allows resolving the current
Locale
as method argument.
Current user session locale will be returned if user is authorized otherwise will be returned default system locale-
Field Summary
Fields inherited from class io.jmix.core.impl.method.TypedArgumentResolver
paramClass
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Locale
resolveArgument
(org.springframework.core.MethodParameter parameter) Resolves a method parameter into an argument value.Methods inherited from class io.jmix.core.impl.method.TypedArgumentResolver
supportsParameter
-
Field Details
-
currentAuthentication
-
-
Constructor Details
-
LocaleArgumentResolver
public LocaleArgumentResolver()
-
-
Method Details
-
resolveArgument
Description copied from interface:MethodArgumentResolver
Resolves a method parameter into an argument value.- Specified by:
resolveArgument
in interfaceMethodArgumentResolver
- Specified by:
resolveArgument
in classTypedArgumentResolver<Locale>
- Parameters:
parameter
- the method parameter to resolve. This parameter must have previously been passed toMethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter)
which must have returnedtrue
.- Returns:
- the resolved argument value, or
null
if not resolvable
-
getCurrentLocale
-