Class DelegatingLocaleResolver

java.lang.Object
org.craftercms.engine.util.spring.servlet.i18n.DelegatingLocaleResolver
All Implemented Interfaces:
org.springframework.web.servlet.LocaleResolver

public class DelegatingLocaleResolver extends Object implements org.springframework.web.servlet.LocaleResolver
Implementation of LocaleResolver that delegates the actual work to the ChainLocaleResolver if available or to a default object. This provides backward compatibility for sites without translation configuration.
Since:
4.0.0
Author:
joseross
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.web.servlet.LocaleResolver
    The default LocaleResolver
  • Constructor Summary

    Constructors
    Constructor
    Description
    DelegatingLocaleResolver(org.springframework.web.servlet.LocaleResolver defaultLocaleResolver)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.web.servlet.LocaleResolver
     
    resolveLocale(javax.servlet.http.HttpServletRequest request)
     
    void
    setLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • defaultLocaleResolver

      protected org.springframework.web.servlet.LocaleResolver defaultLocaleResolver
      The default LocaleResolver
  • Constructor Details

    • DelegatingLocaleResolver

      @ConstructorProperties("defaultLocaleResolver") public DelegatingLocaleResolver(org.springframework.web.servlet.LocaleResolver defaultLocaleResolver)
  • Method Details

    • getDelegate

      protected org.springframework.web.servlet.LocaleResolver getDelegate()
    • resolveLocale

      public Locale resolveLocale(javax.servlet.http.HttpServletRequest request)
      Specified by:
      resolveLocale in interface org.springframework.web.servlet.LocaleResolver
    • setLocale

      public void setLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale)
      Specified by:
      setLocale in interface org.springframework.web.servlet.LocaleResolver