Class RequestLocaleResolver
java.lang.Object
io.micronaut.core.util.locale.AbstractLocaleResolver<HttpRequest<?>>
io.micronaut.http.server.util.locale.HttpAbstractLocaleResolver
io.micronaut.http.server.util.locale.RequestLocaleResolver
- All Implemented Interfaces:
Ordered,LocaleResolver<HttpRequest<?>>,HttpLocaleResolver
@Singleton
@Requires(property="micronaut.server.locale-resolution.header",
notEquals="false")
public class RequestLocaleResolver
extends HttpAbstractLocaleResolver
A locale resolver which resolves the locale via
HttpRequest.getLocale().- Since:
- 2.3.0
- Author:
- Sergio del Amo, James Kleeh
-
Field Summary
FieldsFields inherited from class io.micronaut.http.server.util.locale.HttpAbstractLocaleResolver
httpLocaleResolutionConfigurationFields inherited from class io.micronaut.core.util.locale.AbstractLocaleResolver
defaultLocaleFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionRequestLocaleResolver(HttpLocaleResolutionConfiguration httpLocaleResolutionConfiguration) -
Method Summary
Methods inherited from class io.micronaut.core.util.locale.AbstractLocaleResolver
resolveOrDefaultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.util.LocaleResolver
resolveOrDefault
-
Field Details
-
ORDER
-
-
Constructor Details
-
RequestLocaleResolver
- Parameters:
httpLocaleResolutionConfiguration- Locale resolution configuration
-
-
Method Details
-
resolve
Description copied from interface:LocaleResolverResolves the locale for the given context.- Parameters:
request- The context to retrieve the locale from- Returns:
- The locale
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceOrdered- Overrides:
getOrderin classHttpAbstractLocaleResolver- Returns:
- The order of the object. Defaults to zero (no order).
-