Class LocaleHolder


  • public final class LocaleHolder
    extends java.lang.Object
    Holds the "currently used" Locale in a static thread-local variable. Pieces of code that set or change the locale used in the application runtime should update the static locale stored in this class. See for instance how it is done in the MasterReport implementation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.ThreadLocal<java.util.Locale> current  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private LocaleHolder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Locale get()  
      static void set​(java.util.Locale locale)  
      • Methods inherited from class java.lang.Object

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

      • current

        private static final java.lang.ThreadLocal<java.util.Locale> current
    • Constructor Detail

      • LocaleHolder

        private LocaleHolder()
    • Method Detail

      • set

        public static void set​(java.util.Locale locale)
      • get

        public static java.util.Locale get()