Class AbstractLocaleResolver

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Locale getDefaultLocale()
      Return the default Locale that this resolver is supposed to fall back to, if any.
      java.util.TimeZone getDefaultTimeZone()
      Return the default TimeZone that this resolver is supposed to fall back to, if any.
      protected java.util.Locale resolveDefaultLocale​(Translet translet)
      Resolve the default locale for the given translet, Called if can not find specified Locale.
      protected java.util.TimeZone resolveDefaultTimeZone​(Translet translet)
      Resolve the default time zone for the given translet, Called if can not find specified TimeZone.
      void setDefaultLocale​(java.lang.String defaultLocale)
      Set a default Locale that this resolver will return if no other locale found.
      void setDefaultLocale​(java.util.Locale defaultLocale)
      Set a default Locale that this resolver will return if no other locale found.
      void setDefaultTimeZone​(java.lang.String defaultTimeZone)
      Set a default TimeZone that this resolver will return if no other time zone found.
      void setDefaultTimeZone​(java.util.TimeZone defaultTimeZone)
      Set a default TimeZone that this resolver will return if no other time zone found.
      void setLocale​(Translet translet, java.util.Locale locale)
      Set the current locale to the given one.
      void setTimeZone​(Translet translet, java.util.TimeZone timeZone)
      Set the current timezone to the given one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractLocaleResolver

        public AbstractLocaleResolver()
    • Method Detail

      • getDefaultLocale

        public java.util.Locale getDefaultLocale()
        Return the default Locale that this resolver is supposed to fall back to, if any.
        Returns:
        the default locale
      • setDefaultLocale

        public void setDefaultLocale​(java.util.Locale defaultLocale)
        Set a default Locale that this resolver will return if no other locale found.
        Parameters:
        defaultLocale - the default locale
      • setDefaultLocale

        public void setDefaultLocale​(java.lang.String defaultLocale)
        Set a default Locale that this resolver will return if no other locale found.
        Parameters:
        defaultLocale - the default locale
      • getDefaultTimeZone

        public java.util.TimeZone getDefaultTimeZone()
        Return the default TimeZone that this resolver is supposed to fall back to, if any.
        Returns:
        the default time zone
      • setDefaultTimeZone

        public void setDefaultTimeZone​(java.util.TimeZone defaultTimeZone)
        Set a default TimeZone that this resolver will return if no other time zone found.
        Parameters:
        defaultTimeZone - the default time zone
      • setDefaultTimeZone

        public void setDefaultTimeZone​(java.lang.String defaultTimeZone)
        Set a default TimeZone that this resolver will return if no other time zone found.
        Parameters:
        defaultTimeZone - the default time zone
      • resolveDefaultLocale

        protected java.util.Locale resolveDefaultLocale​(Translet translet)
        Resolve the default locale for the given translet, Called if can not find specified Locale.
        Parameters:
        translet - the translet to resolve the locale for
        Returns:
        the default locale (never null)
        See Also:
        setDefaultLocale(java.util.Locale)
      • resolveDefaultTimeZone

        protected java.util.TimeZone resolveDefaultTimeZone​(Translet translet)
        Resolve the default time zone for the given translet, Called if can not find specified TimeZone.
        Parameters:
        translet - the translet to resolve the time zone for
        Returns:
        the default time zone (or null if none defined)
        See Also:
        setDefaultTimeZone(java.util.TimeZone)
      • setLocale

        public void setLocale​(Translet translet,
                              java.util.Locale locale)
        Description copied from interface: LocaleResolver
        Set the current locale to the given one.
        Specified by:
        setLocale in interface LocaleResolver
        Parameters:
        translet - the translet to resolve the locale for
        locale - the new locale, or null to clear the locale
      • setTimeZone

        public void setTimeZone​(Translet translet,
                                java.util.TimeZone timeZone)
        Description copied from interface: LocaleResolver
        Set the current timezone to the given one.
        Specified by:
        setTimeZone in interface LocaleResolver
        Parameters:
        translet - the translet to resolve the locale for
        timeZone - the new timezone, or null to clear the timezone