Class LoggingLocale

java.lang.Object
org.jboss.logging.LoggingLocale

class LoggingLocale extends Object
A simple utility to resolve the default locale to use for internationalized loggers and message bundles.
  • Field Details

    • LOCALE

      private static final Locale LOCALE
  • Constructor Details

    • LoggingLocale

      LoggingLocale()
  • Method Details

    • getLocale

      static Locale getLocale()
      Attempts to create a Locale based on the org.jboss.logging.locale system property. If the value is not defined the default locale will be used.

      The value should be in the BCP 47 format.

      Note: Currently this uses a custom parser to attempt to parse the BCP 47 format. This will be changed to use the Locale.forLanguageTag() once a move to JDK 7. Currently only the language, region and variant are used to construct the locale.

      Returns:
      the locale created or the default locale
    • getDefaultLocale

      private static Locale getDefaultLocale()
    • forLanguageTag

      private static Locale forLanguageTag(String locale)
    • isAlpha

      private static boolean isAlpha(String value, int minLen, int maxLen)
    • isNumeric

      private static boolean isNumeric(String value, int minLen, int maxLen)
    • isAlphaOrNumeric

      private static boolean isAlphaOrNumeric(String value, int minLen, int maxLen)