Class SessionLocaleResolver

java.lang.Object
io.micronaut.core.util.locale.AbstractLocaleResolver<io.micronaut.http.HttpRequest<?>>
io.micronaut.http.server.util.locale.HttpAbstractLocaleResolver
io.micronaut.session.http.SessionLocaleResolver
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.core.util.LocaleResolver<io.micronaut.http.HttpRequest<?>>, io.micronaut.http.server.util.locale.HttpLocaleResolver

@Singleton @Requires(property="micronaut.server.locale-resolution.session-attribute") public class SessionLocaleResolver extends io.micronaut.http.server.util.locale.HttpAbstractLocaleResolver
Resolves the locale from a property in a session.
Since:
2.3.0
Author:
James Kleeh
  • Field Summary

    Fields inherited from class io.micronaut.http.server.util.locale.HttpAbstractLocaleResolver

    httpLocaleResolutionConfiguration, ORDER

    Fields inherited from class io.micronaut.core.util.locale.AbstractLocaleResolver

    defaultLocale

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    SessionLocaleResolver(io.micronaut.http.server.util.locale.HttpLocaleResolutionConfiguration httpLocaleResolutionConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Optional<Locale>
    resolve(@NonNull io.micronaut.http.HttpRequest<?> request)
     

    Methods inherited from class io.micronaut.http.server.util.locale.HttpAbstractLocaleResolver

    getOrder

    Methods inherited from class io.micronaut.core.util.locale.AbstractLocaleResolver

    resolveOrDefault

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.core.util.LocaleResolver

    resolveOrDefault
  • Constructor Details

    • SessionLocaleResolver

      public SessionLocaleResolver(io.micronaut.http.server.util.locale.HttpLocaleResolutionConfiguration httpLocaleResolutionConfiguration)
      Parameters:
      httpLocaleResolutionConfiguration - The locale resolution configuration
  • Method Details

    • resolve

      @NonNull public @NonNull Optional<Locale> resolve(@NonNull @NonNull io.micronaut.http.HttpRequest<?> request)