@Component(value="core_LocaleArgumentResolver") public class LocaleArgumentResolver extends TypedArgumentResolver<java.util.Locale>
Locale as method argument.
Current user session locale will be returned if user is authorized otherwise will be returned default system locale| Modifier and Type | Field and Description |
|---|---|
protected CurrentAuthentication |
currentAuthentication |
paramClass| Constructor and Description |
|---|
LocaleArgumentResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Locale |
getCurrentLocale() |
java.util.Locale |
resolveArgument(org.springframework.core.MethodParameter parameter)
Resolves a method parameter into an argument value.
|
supportsParameter@Autowired protected CurrentAuthentication currentAuthentication
public java.util.Locale resolveArgument(org.springframework.core.MethodParameter parameter)
MethodArgumentResolverresolveArgument in interface MethodArgumentResolverresolveArgument in class TypedArgumentResolver<java.util.Locale>parameter - the method parameter to resolve. This parameter must
have previously been passed to MethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter) which must
have returned true.null if not resolvableprotected java.util.Locale getCurrentLocale()