Class DefaultLocale


  • public class DefaultLocale
    extends java.lang.Object
    Provides access to the default locale.
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Locale defaultLocale  
      static java.util.Locale INITIAL_LOCALE  
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultLocale()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Locale getDefaultLocale()
      Returns the default locale for evaluation.
      static void setDefaultLocale​(java.util.Locale locale)
      Changes the default locale for evaluation.
      static java.util.Locale toLocale​(java.lang.String loc)
      Turns loc into a locale.
      static java.lang.String toString​(java.util.Locale locale)
      Turns the locale into a string.
      • Methods inherited from class java.lang.Object

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

      • INITIAL_LOCALE

        public static final java.util.Locale INITIAL_LOCALE
      • defaultLocale

        private static java.util.Locale defaultLocale
    • Constructor Detail

      • DefaultLocale

        public DefaultLocale()
    • Method Detail

      • setDefaultLocale

        public static void setDefaultLocale​(java.util.Locale locale)
        Changes the default locale for evaluation.
        Parameters:
        locale - the new locale, ignored if null
      • getDefaultLocale

        public static java.util.Locale getDefaultLocale()
        Returns the default locale for evaluation.
        Returns:
        the locale
      • toString

        public static java.lang.String toString​(java.util.Locale locale)
        Turns the locale into a string.
        Parameters:
        locale - the locale
        Returns:
        the locale as string
      • toLocale

        public static java.util.Locale toLocale​(java.lang.String loc)
        Turns loc into a locale.
        Parameters:
        loc - a string specifying a locale (form: lang[_country]).
        Returns:
        the locale